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. Then create a new virtual environment:

cd datasette-comments
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

And for the JavaScript dependencies (needed to run a JavaScript build):

npm install

To run the tests:

pytest

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

just js

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.2a1.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.2a1-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datasette_comments-0.1.2a1.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.2a1.tar.gz
Algorithm Hash digest
SHA256 d7e977d7442cbed380060ed19420daf23f8fd0c631708fdc0f623e354b217bae
MD5 33ae32a8054ec8092359db77156230f9
BLAKE2b-256 49c9dad47adaba4b3c336428f78a7ffeced3f0c1bb1d304c87f71eff98b605a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_comments-0.1.2a1.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.2a1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_comments-0.1.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa7b71373184251c0c7b68d776f8522b8bf663f8d5ef971fedf1a48bf4b60d8
MD5 a555da64d56d4a25d72f6676ebb0d905
BLAKE2b-256 fa921debd78b547c5c1b0daacb5f98826df3f6d7d7004646a0f4089b9c4a07be

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_comments-0.1.2a1-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