A Datasette plugin for commenting on data in tables.
Read Annotate and explore your data with datasette-comments for background on this project.
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
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
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:
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.
This plugin provies the following plugin hook which can be used to customize its behavior:
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.
The plugin hook can return a list, or it can return an awaitable function that returns a list.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
python3 -m venv venv
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests: