Skip to main content

A Datasette plugin for commenting on tables, rows, and values

Project description

datasette-comments

PyPI Changelog Tests License

A Datasette plugin for commenting on data in tables.

Read Annotate and explore your data with datasette-comments for background on this project.

Installation

datasette-comments requires a recent 1.0 alpha version of Datasette to work.

pip install datasette==1.0a7

Afterwards, install this plugin in the same environment as Datasette.

datasette install datasette-comments

Usage

datasette-comments store comments in Datasette's internal database. So to persistent comments across multiple restarts, supply an database path on startup like so:

datasette --internal internal.db my_data.db

When comments are made on rows inside my_data.db, the comment themselves are stored separately in internal.db.

The datasette-comments-access permission is required to be able to view and add comments. To give permissions to specfic users, set up your metadata.yaml like so:

permissions:
  datasette-comments-access:
    id: ["simonw", "asg017"]

To provide actors and IDs, you'll need to setup a separate Datasette authentication plugin. Consider datasette-auth-passwords for a simple username/password setup.

Plugin hooks

This plugin provies the following plugin hook which can be used to customize its behavior:

datasette_comments_users(datasette)

This hook should return a list of dictionaries, each representing a user that should be made available to the plugin. Each dictionary should have the following keys:

  • id: A unique ID of the user, same as the actor ID.
  • username: A unique string that is used in searches and @ mentions.
  • name: A string of the user's natural name.
  • profile_photo_url: Optional URL to the user's profile pic.
  • email: Optional email used for gravatar profile photo, if enabled.

The plugin hook can return a list, or it can return an awaitable function that returns a list.

Development

To set up this plugin locally, first checkout the code.

The easiest way to run the tests (and commands needed to prepare the environment) is with Just:

cd datasette-comments
just

You can run the tests using uv:

uv run pytest

To install JavaScript dependencies (needed to run a JavaScript build):

npm install

To rebuild the minified JavaScript after making a change to a .ts or .tsx file:

just frontend

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_comments-0.1.2a6.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

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

datasette_comments-0.1.2a6-py3-none-any.whl (45.6 kB view details)

Uploaded Python 3

File details

Details for the file datasette_comments-0.1.2a6.tar.gz.

File metadata

  • Download URL: datasette_comments-0.1.2a6.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datasette_comments-0.1.2a6.tar.gz
Algorithm Hash digest
SHA256 1c20ff4928d1698fd8ddd0e225d17529b0dbf4c82e577dac952aa74c328de6d4
MD5 7b51b3ad0b2f9e24b7e404ae93bdedd6
BLAKE2b-256 ec266a5c1a4577fd8db17680dc48ff076d9a47bbe11d54d615a6f9854d4f59db

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_comments-0.1.2a6.tar.gz:

Publisher: publish.yml on datasette/datasette-comments

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_comments-0.1.2a6-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_comments-0.1.2a6-py3-none-any.whl
Algorithm Hash digest
SHA256 bfae2877646a54bb6afd9d008be6521413ab88ef730972486cb86d540ce683a4
MD5 6222c92e7a653dba1b86d4bcc5e0e959
BLAKE2b-256 11b42f3f152e9d5d8c19eb2fd14e3a99932182874ac58509646f228535265113

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_comments-0.1.2a6-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-comments

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