This release is a pre-release and may not be stable for production use.
datasette-events-forward
Forward Datasette events to another instance
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-events-forward
Configuration
Configure the plugin like so:
{
"plugins": {
"datasette-events-forward": {
"api_token": "***",
"api_url": "https://stats.datasette.cloud/data/-/create",
"instance": "localhost"
}
}
}
The plugin will then gather all events and forward them to the specified instance, adding them to a table called datasette_events which will be created if it does not exist.
The instance key can be used to differentiate different instances that report to the same backend. Events are identified with a ULID to ensure they are unique even across different instances.
Events are forwarded in batches of up to 10, no more than once every 10 seconds.
Full list of configuration settings:
api_url: The write API URL of a Datasette instance to forward the events to.api_token: The API token to use when sending events. Use{"$env": "FORWARD_TOKEN"}to read the token from theFORWARD_TOKENenvironment variable.instance: A string to identify the instance that is sending the events.
The api_url can be either a https://datasette.example.com/data/datasette_events/-/insert endpoint for inserting rows, or a https://datasette.example.com/data/-/create endpoint for creating a table and inserting rows into it. If the table does not yet exist you should use the /-/create variant, otherwise use the /-/insert variant.
If you use /-/insert your API token just needs insert-row permissions. For /-/create you will need create-table permissions as well.
And to control the rate at which batches of events are sent to the Datasette write API:
batch_limit: The number of events to send in each batch, defaults to 10. The Datasette write API has a 100 row limit by default so this should be set to a value less than that.max_rate: The maximum number of deliver HTTP requests to send in the specified time period, defaults to 1.time_period: The time period for the rate limiting in seconds, defaults to 10.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-events-forward
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Release files for datasette-events-forward 0.1a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datasette_events_forward-0.1a4.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_events_forward-0.1a4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / datasette_events_forward-0.1a4.tar.gz
| Download URL | datasette_events_forward-0.1a4.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ab1fbd2729b5c51c7f1bf81cfcbf3df30d5319b011919a05dbd2d4cf9010839
|
|
BLAKE2b-256 checksum How to use checksums |
d5b15578ac409f061341384191e6fa36c988e6c4865f92598c0a6d9f8f78b12a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2025.
Transparency logRelease files / datasette_events_forward-0.1a4-py3-none-any.whl
| Download URL | datasette_events_forward-0.1a4-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a2d0fd8078301d1c371949188a95fd227b770bfef3ef6ece672027aa1ac8829
|
|
BLAKE2b-256 checksum How to use checksums |
78e86358ff3b4b207a3b74c80be798a950f353ebf061083516437014f9e715eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2025.
Transparency log