Skip to main content

dataset-registry

CI codecov PyPI

A version-controlled way to keep track of dataset paths and refer to them by name in code. Data moves -- to a new drive, a new fileshare, a new cluster -- without this registry, every script that hardcodes a path breaks. With it, code refers to a stable id; only the registry's TOML files need to change when a path moves.

A registry is a directory of plain TOML files (usually kept in git), one subdirectory per sample, each with one TOML file per representation (a named path to a piece of data belonging to that sample):

<registry root>/
  <sample directory>/
    sample.toml
    representations/
      <representation file>.toml
      ...

Both samples and representations carry a free-form metadata table, so a project can layer its own validated fields on top (e.g. a pydantic model that parses metadata) without any change to this package.

Installation

pip install git+https://github.com/JaneliaSciComp/dataset_registry

To also use the dsr browse command, install the browse extra:

pip install "dataset-registry[browse] @ git+https://github.com/JaneliaSciComp/dataset_registry"

To get dsr on your PATH from anywhere (not just inside a project's own virtual environment), install it as a uv tool instead:

uv tool install "dataset-registry[browse] @ git+https://github.com/JaneliaSciComp/dataset_registry"

Usage

from dataset_registry import Registry

# A local directory, or a git URL (cloned/cached automatically):
registry = Registry("/path/to/registry")
# registry = Registry("https://github.com/<owner>/<registry-repo>")

sample_id = registry.create_sample("Embryo A", description="a lightsheet embryo")
representation_id = registry.create_representation(
    sample_id, "Raw scan", path="/groups/shroff/raw.tif"
)

representation = registry.load_representation(sample_id, representation_id)
print(representation.path)  # "/groups/shroff/raw.tif"

If the data later moves, update path in place -- every caller that loads this representation by id picks up the new location automatically:

registry.set_representation_fields(sample_id, representation_id, path="/nrs/shroff/raw.tif")

Git URL vs. local directory: two workflows

Registry accepts either a git URL or a local directory, and deliberately treats them differently -- pick whichever matches how your team works:

  • Git URL (Registry("https://github.com/<owner>/<repo>")): for teams where everyone is comfortable with git. Each user gets their own clone, cached under a per-user directory and re-fetched (reset to the remote's default branch tip) on every Registry(...) call by default. Anyone can edit and git push their own changes; everyone else picks them up next time they open the registry. Pass fetch=False to skip the network round-trip and reuse whatever was last fetched.
  • Local directory (Registry("/path/to/registry")): for a shared location (e.g. a fileshare) that non-git-users edit directly, often through dsr browse. Registry is entirely git-oblivious here -- even if the directory happens to be a git working tree, it never fetches, resets, or commits anything on your behalf. A team lead can point the browser at that shared path, let collaborators edit through it, and separately run git add/commit/push by hand whenever they want to snapshot what accumulated.

Browsing a registry

dsr browse /path/to/registry

Serves a live, sortable/filterable table of every sample and representation in the registry, with pages to create and edit samples and representations. Requires the browse extra (fastapi, jinja2, uvicorn).

Development

This project uses uv and just. To set up a development environment:

git clone https://github.com/JaneliaSciComp/dataset_registry
cd dataset_registry
just install

See CONTRIBUTING.md for more, or run just to list all available recipes.

Metadata

Release files for dataset-registry 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dataset-registry 0.2.0
File Size Uploaded Provenance
dataset_registry-0.2.0.tar.gz 128.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dataset-registry 0.2.0
File Interpreter ABI Platform
dataset_registry-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 153.4 kB

Release files / dataset_registry-0.2.0.tar.gz

Download URL dataset_registry-0.2.0.tar.gz
Size 128.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3a16a31b423337f9f461605ce4c9f534bcf8704e2f7296b24f1c2f3053f87113
BLAKE2b-256 checksum
How to use checksums
981d4c3397136151c1df30b15a390245dade8753e3b1e73eb8ac3c335e090a77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Release files / dataset_registry-0.2.0-py3-none-any.whl

Download URL dataset_registry-0.2.0-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d3e1bc61ebc5250cf71b1025b0752353b190ed739f23d9c4a9128de7c9220ba
BLAKE2b-256 checksum
How to use checksums
46f62e35375b02782d086ae079f10a7c5e6e66ea7957cb45dc9edc583f6f2238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Security for dataset-registry 0.2.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dataset_registry-0.2.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 Oct 20, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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