This release is a pre-release and may not be stable for production use.
datasette-export
Export pages from Datasette to files on disk
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-export
Usage
This plugin adds a new export command. You can use this to export one or more pages from Datasette to files on disk.
Pass the --path option one or more times to specify pages:
datasette export mydata.db --path / --path /mydata.json --path /mydata/table1.csv
This will create an export/ directory and save the following files to it:
index.htmlmydata.jsonmydata/table1.csv
Use --output to specify an alternative directory for the export:
datasette export mydata.db --path / --output mywebsite/
In addition to specifying paths, you can pass one or more SQL queries that can return lists of pages to be exported:
datasette export mydata.db --sql "select path from pages"
For example, to export JSON for every row in the fixtures/facetable table:
datasette export fixtures.db \
--sql "select '/fixtures/facetable/' || pk || '.json' from facetable"
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-export
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Metadata
Release files for datasette-export 0.1a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datasette-export-0.1a0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_export-0.1a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / datasette-export-0.1a0.tar.gz
| Download URL | datasette-export-0.1a0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3064cc2826bfbca7eb9d9649d64427f7c8b6cee576e2584b5929e1e0daa8832a
|
|
BLAKE2b-256 checksum How to use checksums |
c3efc64af64001a4370b9435bdb8c7b8e8f55fae415232b0332a40cf84cad2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / datasette_export-0.1a0-py3-none-any.whl
| Download URL | datasette_export-0.1a0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb287d06dadb8ab7d4e60bc8f877773e4a733bf0cfbcc6ecd5b15756fd4e4899
|
|
BLAKE2b-256 checksum How to use checksums |
dec7d486319357f442c817926e238fe98690c44fadc14e61601ab8e0e4bacb35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|