Skip to main content

Import data from Socrata into Datasette

Project description

datasette-socrata

PyPI Changelog Tests License

Import data from Socrata into Datasette

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-socrata

Usage

Make sure you have enabled WAL mode on your database files before using this plugin.

Once installed, an interface for importing data from Socrata will become available at this URL:

/-/import-socrata

Users will be able to paste in a URL to a dataset on Socrata in order to initialize an import.

You can also pre-fill the form by passing a ?url= parameter, for example:

/-/import-socrata?url=https://data.sfgov.org/City-Infrastructure/Street-Tree-List/tkzw-k3nq

Any database that is attached to Datasette, is NOT loaded as immutable (with the -i option) and that has WAL mode enabled will be available for users to import data into.

The import-socrata permission governs access. By default the root actor (accessible using datasette --root to start Datasette) is granted that permission.

You can use permission plugins such as datasette-permissions-sql to grant additional access to other users.

Configuration

If you only want Socrata imports to be allowed to a specific database, you can configure that using plugin configration in metadata.yml:

plugins:
  datasette-socrata:
    database: socrata

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-socrata
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette-socrata-0.3.1.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

datasette_socrata-0.3.1-py3-none-any.whl (12.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page