dserver Dependency Graph Plugin
GitHub: https://github.com/jic-dtool/dserver-dependency-graph-plugin
PyPI: https://pypi.python.org/pypi/dserver-dependency-graph-plugin
Free software: MIT License
Features
Use a dataset UUID to look up all datasets within the same dependency graph, with the dependencies between them
Dependencies are read from configurable keys, e.g. derived_from in the README or a source_dataset_uuid annotation
Introduction
dtool is a command line tool for packaging data and metadata into a dataset. A dtool dataset manages data and metadata without the need for a central database.
However, if one has to manage more than a hundred datasets it can be helpful to have the datasets’ metadata stored in a central server to enable one to quickly find datasets of interest.
The dservercore provides a web API for registering datasets’ metadata and provides functionality to lookup, list and search for datasets.
This plugin enables the dserver to directly provide all datasets within a specific dependency graph.
Installation
Install the dserver dependency graph plugin
$ pip install dserver-dependency-graph-plugin
Setup and configuration
Configure plugin behavior
Datasets name the datasets they were derived from under the dependency keys. The JSON-formatted list
export DSERVER_DEPENDENCY_KEYS='["readme_parsed.derived_from.uuid", "annotations.source_dataset_uuid"]'
is the default: derived_from entries in the README (as parsed by the server, readme_parsed) and the annotation source_dataset_uuid. All keys are treated equivalently and nested fields are separated by the dot (.). The actual nesting hierarchy does not matter. This means, for example, both structures evaluate equivalently in the following
{'readme_parsed': {'derived_from': {'uuid':
['8ecd8e05-558a-48e2-b563-0c9ea273e71e',
'faa44606-cb86-4877-b9ea-643a3777e021']}}}
{'readme_parsed': {'derived_from':
[{'uuid': '8ecd8e05-558a-48e2-b563-0c9ea273e71e'},
{'uuid': 'faa44606-cb86-4877-b9ea-643a3777e021'}]}}
Values that are not UUIDs are ignored. The plugin creates MongoDB indexes on uuid and the dependency keys at startup.
Further options:
DSERVER_ENABLE_DEPENDENCY_VIEW (default True): enables the graph routes.
DSERVER_DEPENDENCY_GRAPH_MAX_SIZE (default 1000): a graph is explored up to this many datasets.
DSERVER_DYNAMIC_DEPENDENCY_KEYS (default False): lets clients choose other dependency keys (see below). Keys without an index make every graph query scan the collection, so this is off by default.
Note that the above exports containing JSON syntax are formatted for usage in bash. Enclosing single quotes are not to be part of the actual variable value when environment variables are configured elsewhere.
How graphs are explored
Starting from the requested dataset, the graph is explored level by level in both directions: the datasets a dataset names as its parents, and the datasets naming it. Every query is restricted to the base URIs the user may search, so the graph never passes through, and the response never mentions, datasets the user cannot see. A user with access to only part of a graph gets that part.
Previous versions cached MongoDB views (dep:...) and a bookkeeping collection (dep_views); they are no longer used and can be dropped.
dserver API
dserver makes use of the Authorized header to pass through the JSON web token for authorization. Below we create environment variables for the token and the header used in the curl commands
$ TOKEN=$(flask user token olssont)
$ HEADER="Authorization: Bearer $TOKEN"
Standard user usage
Looking up dependency graphs based on a dataset’s UUID
A dataset can be derived from one or several source datasets, usually by machine-generated annotations attached via the Python API at dataset creation time, or manually by recording the UUIDs of parent datasets in some arbitrary fields within the README.yml. If configured appropriately, querying the server directly for all datasets within the same dependency graph by UUID is possible, i.e.
$ UUID=41a2e3e2-0c01-444f-bd7d-f9bb45512373
$ curl -H "$HEADER" http://localhost:5000/graph/uuids/$UUID
The response lists the datasets in the graph (sorted by UUID), each with derived_from: the UUIDs of its parents within the graph. It is paginated (page, page_size up to 100, X-Pagination header). A dataset registered in several base URIs appears once, from the first of these base URIs in alphabetical order.
Looking up graphs spanned by other dependency keys
If DSERVER_DYNAMIC_DEPENDENCY_KEYS=True, then the client may ask the server to explore a graph spanned by dependency keys differing from the server-side defaults in DSERVER_DEPENDENCY_KEYS, with a POST request
$ curl -H "$HEADER" -H "Content-Type: application/json" -X POST \
-d '{"dependency_keys": ["annotations.source_dataset_uuid"]}' \
http://localhost:5000/graph/uuids/$UUID
Otherwise, the server uses its own keys.
Metadata
Release files for dserver-dependency-graph-plugin 0.5.0
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 |
|---|---|---|---|---|
| dserver_dependency_graph_plugin-0.5.0.tar.gz | 18.9 kB | With provenance | Details for dserver_dependency_graph_plugin-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dserver_dependency_graph_plugin-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for dserver_dependency_graph_plugin-0.5.0-py3-none-any.whl |
Total release size: 30.4 kB
Release files / dserver_dependency_graph_plugin-0.5.0.tar.gz
| Download URL | dserver_dependency_graph_plugin-0.5.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00e2eb1c4fe08c47428f42611112df378dc0e8157ed690dbcdad329895a75cad
|
|
BLAKE2b-256 checksum How to use checksums |
50dfcbbcf02c734d32ec454635c5e50bd2468b840ae2fafc5b1048e72964d1d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 29, 2026.
Transparency logRelease files / dserver_dependency_graph_plugin-0.5.0-py3-none-any.whl
| Download URL | dserver_dependency_graph_plugin-0.5.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70f323e1c38dd1c00a102b2d5ed9662ad64e1268744f944966c3876548c34658
|
|
BLAKE2b-256 checksum How to use checksums |
b43dd9c81083b7250cfca31eccb377a8e91b7c6d4b4beeb2f7d4aed554e36f14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 29, 2026.
Transparency logSecurity for dserver-dependency-graph-plugin 0.5.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dserver_dependency_graph_plugin-0.5.0.tar.gz
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 29, 2026.
Transparency logA 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.