Skip to main content

Make specific Datasette tables visible to the public

Project description

datasette-public

PyPI Changelog Tests License

Make specific Datasette tables visible to the public

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-public

Usage

Any tables listed in the _public_tables table will be visible to the public, even if the rest of the Datasette instance does not allow anonymous access.

The root user (and any user with the new public-tables permission) will get a new option in the table action menu allowing them to toggle a table between public and private.

Installing this plugin also causes allow-sql permission checks to fall back to checking if the user has access to the entire database. This is to avoid users with access to a single public table being able to access data from other tables using the ?_where= query string parameter.

Configuration

This plugin creates a new table in one of your databases called _public_tables.

This table defaults to being created in the first database passed to Datasette.

To create it in a different named database, use this plugin configuration:

{
  "plugins": {
    "datasette-public": {
      "database": "database_to_create_table_in"
    }
  }
}

Development

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

cd datasette-public
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-public-0.2.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

datasette_public-0.2.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file datasette-public-0.2.3.tar.gz.

File metadata

  • Download URL: datasette-public-0.2.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for datasette-public-0.2.3.tar.gz
Algorithm Hash digest
SHA256 8c138d82aeecc5f9107f75f118f16329d96e66ee733a1c2bb675185fa1442c89
MD5 6fb901f6cdf6106a3ac576376ebc5d0c
BLAKE2b-256 a2da0294a83be720bc8fb4d362d629055307a64edf5ac25365552019713f1358

See more details on using hashes here.

File details

Details for the file datasette_public-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_public-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a7c5b5612c7426b2dd25da56efdf42e96eb4e64e55dc7ea71944a30312648cc
MD5 ad48eb8aac4e18e1376e49fddcd5d707
BLAKE2b-256 f65ac4c21bde6951d64f0ca06a8874f8d34e83abb8db86aad804c9cf9ca72ce9

See more details on using hashes here.

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