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

Uploaded Python 3

File details

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

File metadata

  • Download URL: datasette_comments-0.1.2a2.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.2a2.tar.gz
Algorithm Hash digest
SHA256 b8fb0d22fda3284c7690facff59fe6e2832b77b79d989203f7360030eadaeeb4
MD5 b2be289c743fcf542a04a9c3614f08b9
BLAKE2b-256 819d74ec38f2c5a2cf55df8b0f88df8c9429598079457630f243c5b8a14d5c1a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for datasette_comments-0.1.2a2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9be89377c02cc9973562ac490973dd57453a59f10e34336d4e78c4fe674cdc
MD5 a8c9883b37b664639af286a22a15f345
BLAKE2b-256 a2506ad4e9dfa3d251b7ddf60e386a061e2437d855282a0c4ecb7a87208bfbaf

See more details on using hashes here.

Provenance

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