Part of https://github.com/simonw/datasette-app
Project description
datasette-app-support
Part of https://github.com/simonw/datasette-app
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-app-support
API endpoints
This plugin exposes APIs that are called by the Electron wrapper.
/-/open-database-file
POST /-/open-database-file
{"path": "/path/to/file.db"}
Attaches a new database file to the running Datasette instance - used by the "Open Database..." menu option.
Returns HTTP 200 status with {"ok": True, "path": "/file"}
if it works, 400 with an "error"
JSON string message if it fails.
/-/new-empty-database-file
POST /-/new-empty-database-file
{"path": "/path/to/file.db"}
Creates a brand new empty SQLite database file at the specified path and attaches it to the Datasette instance. Used by the "Create Empty Database..." menu option.
Returns HTTP 200 status with {"ok": True, "path": "/file"}
if it works, 400 with an "error"
JSON string message if it fails.
/-/open-csv-file
POST /-/open-csv-file
{"path": "/path/to/file.csv"}
Impors a CSV or TSV file into the default /temporary
in-memory database. Used by the "Open CSV/TSV..." menu option.
Returns HTTP 200 status with {"ok": True, "path": "/temporary/file"}
if it works, 400 or 500 with an "error"
JSON string message if it fails.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-app-support
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for datasette-app-support-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d151b005cfc22355c34b9e28ea85b9aa7bd1ddd7ad0b5b6d29a42fbeeccd98f7 |
|
MD5 | 8e9bf76a3a6e14db12a80d942aa3f9e0 |
|
BLAKE2b-256 | d80ffe58e5160b4e6b5c7d001a10af20fe80e6cd1758b45306580f3cea9097c9 |
Hashes for datasette_app_support-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d086c3bc42bfd61a38859805c3f5d82a7c50e1ae6986162ed2b42f7113e9aa |
|
MD5 | 878ee5effb6d9ca39faaaf07b50300ed |
|
BLAKE2b-256 | 5c738e2eb3804ee3ed3185beb019a362533a2e510a51f8d53227557535dc819a |