datasette-remote-metadata
Periodically refresh Datasette metadata from a remote URL
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-remote-metadata
Usage
Add the following to your metadata.json:
{
"plugins": {
"datasette-remote-metadata": {
"url": "https://example.com/remote-metadata.yml"
}
}
}
The plugin will fetch the specified metadata from that URL at startup and combine it with any existing metadata. You can use a URL to either a JSON file or a YAML file.
It will periodically refresh that metadata - by default every 30 seconds, unless you specify an alternative "ttl" value in the plugin configuration.
Configuration
Available configuration options are as follows:
"url"- the URL to retrieve remote metadata from. Can link to a JSON or a YAML file."ttl"- integer value in secords: how frequently should the script check for fresh metadata. Defaults to 30 seconds."headers"- a dictionary of additional request headers to send."cachebust"- if true, a random?0.29508value will be added to the query string of the remote metadata to bust any intermediary caches.
This example metadata.json configuration refreshes every 10 seconds, uses cache busting and sends an Authorization: Bearer xyz header with the request:
{
"plugins": {
"datasette-remote-metadata": {
"url": "https://example.com/remote-metadata.yml",
"ttl": 10,
"cachebust": true,
"headers": {
"Authorization": "Bearer xyz"
}
}
}
}
This example if you are using metadata.yaml for configuration:
plugins:
datasette-remote-metadata:
url: https://example.com/remote-metadata.yml
ttl: 10
cachebust: true
headers:
Authorization: Bearer xyz
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-remote-metadata
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv:
pipenv shell
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Metadata
Release files for datasette-remote-metadata 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasette-remote-metadata-0.1.tar.gz | 3.6 kB | Without provenance | Details for datasette-remote-metadata-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasette_remote_metadata-0.1-py3-none-any.whl | Python 3 | none | any | Details for datasette_remote_metadata-0.1-py3-none-any.whl |
Total release size: 7.3 kB
Release files / datasette-remote-metadata-0.1.tar.gz
| Download URL | datasette-remote-metadata-0.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaa2a2205eb700cfcfbb342813d1a454208e221324b5cee09cb686b03314a046
|
|
BLAKE2b-256 checksum How to use checksums |
eb9c4f9fb6d35732958af98566cdfbdf3b965e820b47e03d3bc88432faf310da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / datasette_remote_metadata-0.1-py3-none-any.whl
| Download URL | datasette_remote_metadata-0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1c41cf3b836ae44105d8f86ad989f672209603b20f76c2dcaca92082a6eff4a
|
|
BLAKE2b-256 checksum How to use checksums |
4bea9a92446ead3ec6baf8921515533a6067f31bc41ff525935eda6e4c81454d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Security for datasette-remote-metadata 0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.