Skip to main content

Acquisition Namespace

PyPI

YAML-driven hierarchical path namespace builder for acquisition data pipelines.

→ Full documentation

Define your session directory layout once in a YAML spec; the library builds, parses, and validates paths at every level of the hierarchy — with zero hard-coded separators or string constants in your application code.

Installation

pip install acquisition-namespace

Or with uv:

uv add acquisition-namespace

Quick start

from acquisition_namespace import NamespaceBuilder

builder = NamespaceBuilder.from_yaml("my_namespace.yaml")

# Build the session basename from component values
name = builder.build_path("session", {
    "subject": "mouse_01",
    "datetime": "20260524_143022_123456",
    "task": "sequence",
})
# → "mouse_01__20260524_143022_123456__sequence"

# Build the full directory path from root to the session level
path = builder.generate_path("session", {...})
# → "mouse_01/mouse_01__20260524_143022_123456__sequence"

# Parse an existing path back into its fields
parts = builder.extract_level_values("session", name)
# → {"subject": "mouse_01", "datetime": "...", "task": "sequence"}

Spec YAML format

version: "1.0"
description: "My acquisition namespace."
hierarchy:
  - subject
  - session
  - file
optional_levels: []
levels:
  subject:
    template: "{subject}"
    regex: "(?P<subject>[\\w\\-]+)"
    optional_fields: []
  session:
    template: "{subject}__{datetime}__{task}"
    regex: "(?P<subject>[\\w\\-]+)__(?P<datetime>\\d{8}_\\d{6}(?:_\\d{6})?)__(?P<task>[\\w\\-]+)"
    optional_fields: []
  file:
    template: "{session}.{suffix}.{extension}"
    regex: "(?P<session>.+)\\.(?P<suffix>\\w+)\\.(?P<extension>\\w+)"
    optional_fields: []

Higher-level templates may reference lower-level names (e.g. {session} in the file template); the builder resolves them automatically.

Development setup

git clone https://github.com/murineshiftwork/acquisition-namespace.git
cd acquisition-namespace
uv sync --group dev
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
uv run pytest

Release workflow

  1. Work on a feature/ or fix/ branch, committing with cz commit
  2. Open a PR — CI (lint + tests + secrets scan) must pass before merge
  3. Merge to main → version bump and tag are created automatically
  4. Tag triggers release: GitHub release + PyPI publish

License

See LICENSE.

Metadata

Release files for acquisition-namespace 1.3.3

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

Source distribution (sdist)

Source distribution for acquisition-namespace 1.3.3
File Size Uploaded Provenance Actions
acquisition_namespace-1.3.3.tar.gz 13.9 kB Without provenance Details for acquisition_namespace-1.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for acquisition-namespace 1.3.3
File Interpreter ABI Platform Actions
acquisition_namespace-1.3.3-py3-none-any.whl Python 3 none any Details for acquisition_namespace-1.3.3-py3-none-any.whl

Total release size: 24.7 kB

Release files / acquisition_namespace-1.3.3.tar.gz

Download URL acquisition_namespace-1.3.3.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fcdd97440e45e5dd44097958ca0997419cafe0c0b88603e1a350c764be9ef880
BLAKE2b-256 checksum
How to use checksums
fef335bcabd104cb776cf0f06cd718380cc1afc276d43aca686e6e885c98a531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / acquisition_namespace-1.3.3-py3-none-any.whl

Download URL acquisition_namespace-1.3.3-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28f74038a6cb271a29a1eef95e01e774d5308a7f4eff881b7bcda55a7c9b5c53
BLAKE2b-256 checksum
How to use checksums
d9529de47894cbf7fb8f59a930024ca01adb0c4715243c9b293ab5bbe35778af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for acquisition-namespace 1.3.3

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.

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