Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

datasette-remote-actors

PyPI Changelog Test License

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:

  1. Accept a GET request.
  2. Accept a query string parameter ids containing a comma-separated list of actor IDs (e.g., ?ids=1,a2,b3).
  3. Return a JSON response with a 200 OK status code upon success.
  4. 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 id field, which can be a string or an integer matching the requested ID. Other fields (like name, 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 (if ttl is 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-memory TTLCache (default maxsize=1000). Omit this or set to 0 for no caching.
  • token (string, optional): An authentication token. If provided, it will be sent in the Authorization: Bearer <token> HTTP header when calling the url.
  • datasette-profiles (boolean, optional): Set to true to enable integration with the datasette-profiles plugin. Defaults to false.

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.

  1. Install the companion plugin:
    datasette install datasette-profiles
    
  2. Enable the integration in the datasette-remote-actors configuration:
    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 profiles table (created by datasette-profiles) in Datasette's internal database for matching actor IDs.
  • If a profile exists for an actor ID, the data from the profiles table will be merged into the actor dictionary fetched from the remote URL. Any non-null values in the profiles table (except the id column 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)

Source distribution for datasette-remote-actors 0.1a7
File Size Uploaded
datasette_remote_actors-0.1a7.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datasette-remote-actors 0.1a7
File Interpreter ABI Platform
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 log

Release 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page