This release is a pre-release and may not be stable for production use.
datasette-remote-actors
A Datasette plugin for fetching details of actors (users or API clients) from a remote, centralized JSON endpoint.
See Datasette issue #2180 for background on this plugin.
Installation
datasette install datasette-remote-actors
API Endpoint Requirements
Configure this plugin with a URL pointing to an API endpoint that provides actor information.
This endpoint must:
- Accept a GET request.
- Accept a query string parameter
idscontaining a comma-separated list of actor IDs (e.g.,?ids=1,a2,b3). - Return a JSON response with a
200 OKstatus code upon success. - The JSON response body must be a dictionary where the keys are the string representations of the actor IDs requested, and the values are dictionaries containing the details for each actor.
Example Request:
GET /path/to/your/endpoint?ids=1,2
Example Successful JSON Response:
{
"1": {
"id": "1",
"name": "Cleopatra",
"email": "cleo@example.com"
},
"2": {
"id": 2,
"name": "Julius Caesar",
"username": "jcaesar"
}
}
Important Notes:
- The keys in the returned JSON object (
"1","2"in the example) must be strings, even if the original IDs are integers. - Each actor dictionary value must contain an
idfield, which can be a string or an integer matching the requested ID. Other fields (likename,username,email) are flexible and defined by your endpoint. - Small Actor Sets: If you have a small, fixed number of actors, your endpoint can optionally ignore the
?ids=parameter and always return the entire dictionary of all known actors. The plugin will cache these and use the cached data for subsequent lookups (ifttlis configured). - Error Handling: If the remote endpoint returns a non-200 status code, times out, or returns invalid JSON, this plugin will log an error (if Datasette logging is configured) and will not return actor data for the requested IDs for that request.
Configuration
You configure the plugin using Datasette's metadata.json or metadata.yaml file.
Minimal Configuration:
plugins:
datasette-remote-actors:
url: https://example.com/actors.json
Full Configuration Example:
plugins:
datasette-remote-actors:
# (Required) URL to the remote actor endpoint
url: https://example.com/actors.json
# (Optional) Cache Time-To-Live in seconds.
# If set, actor details will be cached in memory.
# Uses cachetools.TTLCache with a default maxsize of 1000.
# Omit for no caching.
ttl: 60
# (Optional) Bearer token for authentication.
# If set, adds an "Authorization: Bearer <token>" header to the request.
token: your-secret-api-token
# (Optional) Enable integration with datasette-profiles.
# Requires datasette-profiles plugin to be installed.
# See section below for details.
datasette-profiles: true
Configuration Options:
url(string, required): The URL to the endpoint that can resolve actor IDs into JSON actor dictionaries.ttl(integer, optional): The number of seconds to cache the result for a specific actor ID. Uses an in-memoryTTLCache(defaultmaxsize=1000). Omit this or set to0for no caching.token(string, optional): An authentication token. If provided, it will be sent in theAuthorization: Bearer <token>HTTP header when calling theurl.datasette-profiles(boolean, optional): Set totrueto enable integration with the datasette-profiles plugin. Defaults tofalse.
Integration with datasette-profiles
If you want to allow users to override or supplement the actor details fetched from the remote endpoint with their own profile information stored within Datasette, you can use the datasette-profiles plugin.
- Install the companion plugin:
datasette install datasette-profiles
- Enable the integration in the
datasette-remote-actorsconfiguration:plugins: datasette-remote-actors: url: https://example.com/actors.json datasette-profiles: true # other options...
When enabled:
- The plugin will first fetch actor details from the configured
url. - It will then query the
profilestable (created bydatasette-profiles) in Datasette's internal database for matching actor IDs. - If a profile exists for an actor ID, the data from the
profilestable will be merged into the actor dictionary fetched from the remote URL. Any non-null values in theprofilestable (except theidcolumn itself) will overwrite corresponding keys from the remote data.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-remote-actors
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Metadata
Release files for datasette-remote-actors 0.1a7
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_remote_actors-0.1a7.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_remote_actors-0.1a7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / datasette_remote_actors-0.1a7.tar.gz
| Download URL | datasette_remote_actors-0.1a7.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb3d1958b22078a9e5cb89620b9c52b7b034706c2ca41ec74a713b77951782bc
|
|
BLAKE2b-256 checksum How to use checksums |
a1a77dbe3f5122187365dddc1965b44968407a5eb87be7b9fdf887e7bd438342
|
| 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 8, 2025.
Transparency logRelease files / datasette_remote_actors-0.1a7-py3-none-any.whl
| Download URL | datasette_remote_actors-0.1a7-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d489dfc75ba7c9bba83f84878c03992a5ee1c6dd00c1ec4dff520a7974da9f4b
|
|
BLAKE2b-256 checksum How to use checksums |
3b033d5de00cd7053de2c59f5220be68dccf5260d89c690cc80d0c45533a8815
|
| 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 8, 2025.
Transparency log