Skip to main content

Make selected Datasette databases and tables visible to the public

Project description

datasette-public

PyPI Changelog Tests License

Make selected Datasette databases and tables 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 and table action menu items allow users with the datasette-public permission to toggle both tables and databases 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 and tables include an audit log of changes that have been made to their public status.

Internals

This plugin uses three tables in the internal database:

  • public_databases - stores the public status of databases and if execute SQL is enabled
  • public_tables - stores the public status of tables
  • public_audit_log - stores the history of changes to the public status of databases and tables

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


Download files

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

Source Distribution

datasette_public-0.3a2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_public-0.3a2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file datasette_public-0.3a2.tar.gz.

File metadata

  • Download URL: datasette_public-0.3a2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for datasette_public-0.3a2.tar.gz
Algorithm Hash digest
SHA256 1f6aec2fc2fb38fe5b49c87be923211369a80dd37020ea1e5cf105fb2d8236c0
MD5 f79ee8a1aa19b5f3db31ee8f64b5b5b2
BLAKE2b-256 1c24aac3250be94e4179407d819ca84a238097a6e0cf4667f3f050ee16fad1dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_public-0.3a2.tar.gz:

Publisher: publish.yml on datasette/datasette-public

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_public-0.3a2-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_public-0.3a2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfad687103f8043b730ee9b84cf4059f9a694d7bf8c6d3215e3af037b43c9504
MD5 d02f4a699cccf81ebfaed3d3299917ee
BLAKE2b-256 7526cb8cb684230882a0367170d3232dab63a3da356cae019555a1543f5e62fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_public-0.3a2-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-public

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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