Skip to main content

datasette-demo-dbs

PyPI Changelog Tests License

Fetch missing demo DBs from URLs when Datasette first starts

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-demo-dbs

Configuration

Configure the plugin in your Datasette metadata (YAML or JSON). You specify:

  • path: directory on disk where downloaded .db files will be stored (defaults to current directory)
  • dbs: a mapping of database name to the URL of the SQLite database file

Example metadata.yml:

plugins:
  datasette-demo-dbs:
    path: ./demo-dbs
    dbs:
      demo: https://example.com/path/to/demo.db
      census: https://example.com/path/to/census.db

Equivalent metadata.json:

{
  "plugins": {
    "datasette-demo-dbs": {
      "path": "./demo-dbs",
      "dbs": {
        "demo": "https://example.com/path/to/demo.db",
        "census": "https://example.com/path/to/census.db"
      }
    }
  }
}

How it works

On Datasette startup, for each entry in dbs:

  1. If path/<name>.db already exists, it is left as-is and loaded into Datasette.
  2. If a marker file path/<name>.deleted exists, the download is skipped.
  3. Otherwise, the plugin downloads the content from the URL (following redirects), streams it to path/<name>.db, and registers that database in Datasette under the given name.

Development

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

cd datasette-demo-dbs
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

python -m pytest

Release files for datasette-demo-dbs 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datasette-demo-dbs 0.1.1
File Size Uploaded
datasette_demo_dbs-0.1.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datasette-demo-dbs 0.1.1
File Interpreter ABI Platform
datasette_demo_dbs-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / datasette_demo_dbs-0.1.1.tar.gz

Download URL datasette_demo_dbs-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
10696bd70b0209d033faf61089fe00c69e6a69e3b4cdb5a40991929dcba93b11
BLAKE2b-256 checksum
How to use checksums
a3af2b012f6af95dc94f38fccdd22627549dc7e9c1cd02dec88700580fa2eb14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Release files / datasette_demo_dbs-0.1.1-py3-none-any.whl

Download URL datasette_demo_dbs-0.1.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fdc1d52f1c6356089719ac2eca604abcea5f5f56941ff77011759de8e81ec67
BLAKE2b-256 checksum
How to use checksums
64adb12ef75725f50f5a98b4019d07e019736c1432ca58268c784219900b371d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page