A Datasette plugin for commenting on tables, rows, and values
Project description
datasette-comments
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e977d7442cbed380060ed19420daf23f8fd0c631708fdc0f623e354b217bae
|
|
| MD5 |
33ae32a8054ec8092359db77156230f9
|
|
| BLAKE2b-256 |
49c9dad47adaba4b3c336428f78a7ffeced3f0c1bb1d304c87f71eff98b605a1
|
Provenance
The following attestation bundles were made for datasette_comments-0.1.2a1.tar.gz:
Publisher:
publish.yml on datasette/datasette-comments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_comments-0.1.2a1.tar.gz -
Subject digest:
d7e977d7442cbed380060ed19420daf23f8fd0c631708fdc0f623e354b217bae - Sigstore transparency entry: 1323278341
- Sigstore integration time:
-
Permalink:
datasette/datasette-comments@1ef29ebc8943ef377d83e5e04b70d2d97dbb2f58 -
Branch / Tag:
refs/tags/0.1.2.a1 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1ef29ebc8943ef377d83e5e04b70d2d97dbb2f58 -
Trigger Event:
release
-
Statement type:
File details
Details for the file datasette_comments-0.1.2a1-py3-none-any.whl.
File metadata
- Download URL: datasette_comments-0.1.2a1-py3-none-any.whl
- Upload date:
- Size: 45.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa7b71373184251c0c7b68d776f8522b8bf663f8d5ef971fedf1a48bf4b60d8
|
|
| MD5 |
a555da64d56d4a25d72f6676ebb0d905
|
|
| BLAKE2b-256 |
fa921debd78b547c5c1b0daacb5f98826df3f6d7d7004646a0f4089b9c4a07be
|
Provenance
The following attestation bundles were made for datasette_comments-0.1.2a1-py3-none-any.whl:
Publisher:
publish.yml on datasette/datasette-comments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasette_comments-0.1.2a1-py3-none-any.whl -
Subject digest:
3fa7b71373184251c0c7b68d776f8522b8bf663f8d5ef971fedf1a48bf4b60d8 - Sigstore transparency entry: 1323278453
- Sigstore integration time:
-
Permalink:
datasette/datasette-comments@1ef29ebc8943ef377d83e5e04b70d2d97dbb2f58 -
Branch / Tag:
refs/tags/0.1.2.a1 - Owner: https://github.com/datasette
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1ef29ebc8943ef377d83e5e04b70d2d97dbb2f58 -
Trigger Event:
release
-
Statement type: