Make selected Datasette databases and tables visible to the public
Project description
datasette-public
Make selected Datasette databases, tables and queries visible to the public
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-public
Usage
This plugin can only be used with Datasette 1.0a+ and requires Datasette to be run with a persistent internal database:
datasette --internal internal.db data.db
To grant datasette-public permission to the root user run the following:
datasette --internal internal.db data.db --root \
-s permissions.datasette-public.id root
New database, table and query action menu items allow users with the datasette-public permission to toggle databases, tables and queries between public and private.
For databases, users can also select if the ability to execute arbitrary SQL should be exposed to the public.
If a table is public but the database is private, users will not we able to use the ?_where= parameter on that table.
The interfaces for managing the visibility of databases, tables and queries include an audit log of changes that have been made to their public status.
Internals
This plugin uses four tables in the internal database:
public_databases- stores the public status of databases and if execute SQL is enabledpublic_tables- stores the public status of tablespublic_queries- stores the public status of queriespublic_audit_log- stores the history of changes to the public status of databases, tables and queries
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-public
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
In local development it's useful to run Datasette with everything made private by default:
datasette data.db \
--internal internal.db \
-s allow.id root \
-s permissions.datasette-public.id root \
--root \
--secret fixed \
--reload
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasette_public-0.3a4.tar.gz.
File metadata
- Download URL: datasette_public-0.3a4.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e722849d9a12f4bbd4c560ff56b53f6ebac10088c2bb978fb6fe7e62cc2cfbf3
|
|
| MD5 |
6f8c05f3c71b700f1b7348f5d02b3a6c
|
|
| BLAKE2b-256 |
bbfb1104e70f8a8858d0ebf0c74e895a407a4a303200b51c5fdd32c4db54694e
|
Provenance
The following attestation bundles were made for datasette_public-0.3a4.tar.gz:
Publisher:
publish.yml on datasette/datasette-public
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_public-0.3a4.tar.gz -
Subject digest:
e722849d9a12f4bbd4c560ff56b53f6ebac10088c2bb978fb6fe7e62cc2cfbf3 - Sigstore transparency entry: 628747908
- Sigstore integration time:
-
Permalink:
datasette/datasette-public@4c15db6e40f359a9989f7ff6a632d05ddd210566 -
Branch / Tag:
refs/tags/0.3a4 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c15db6e40f359a9989f7ff6a632d05ddd210566 -
Trigger Event:
release
-
Statement type:
File details
Details for the file datasette_public-0.3a4-py3-none-any.whl.
File metadata
- Download URL: datasette_public-0.3a4-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5b8c35a77574810fc6079a92cd448e97d07a5fe184b77f1406198aa107c8a71
|
|
| MD5 |
d129039e58dd6e8e1d35d1011db9bee7
|
|
| BLAKE2b-256 |
ea9e9b968f062710cef9d5bd76270188c7159fd45f353500e3219e4c6a400286
|
Provenance
The following attestation bundles were made for datasette_public-0.3a4-py3-none-any.whl:
Publisher:
publish.yml on datasette/datasette-public
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_public-0.3a4-py3-none-any.whl -
Subject digest:
e5b8c35a77574810fc6079a92cd448e97d07a5fe184b77f1406198aa107c8a71 - Sigstore transparency entry: 628747909
- Sigstore integration time:
-
Permalink:
datasette/datasette-public@4c15db6e40f359a9989f7ff6a632d05ddd210566 -
Branch / Tag:
refs/tags/0.3a4 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c15db6e40f359a9989f7ff6a632d05ddd210566 -
Trigger Event:
release
-
Statement type: