Nightjar
A config dispatch library. Supports dataclasses, Pydantic models, and custom converters.
Install
uv add nightjar
Usage
from dataclasses import dataclass
from nightjar import dispatch, register
@dataclass
class StorageConfig:
pass
@dataclass
class LocalConfig(StorageConfig):
kind: str = "local"
path: str = "."
@dataclass
class MemoryConfig(StorageConfig):
kind: str = "memory"
capacity: int = 100
@register(kind="local")
@dataclass
class LocalStorage:
config: LocalConfig
@register(kind="memory")
@dataclass
class MemoryStorage:
config: MemoryConfig
storage = dispatch(StorageConfig, {"kind": "memory", "capacity": "20"})
assert isinstance(storage, MemoryStorage)
assert storage.config.capacity == 20
local = dispatch(StorageConfig, {"kind": "local", "path": "./data"})
assert isinstance(local, LocalStorage)
The caller supplies StorageConfig; kind selects the implementation.
@register infers each concrete config type from its annotation.
Compatibility
- Python 3.9+: use
from __future__ import annotationsforA | Bannotations on 3.9. - Pydantic v1.10 and v2 are supported without an exact version pin. Conversion behavior follows the installed version; uv resolves a compatible release.
Preview the documentation with uv run --group docs mkdocs serve.
Metadata
Release files for nightjar 0.1.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 |
|---|---|---|---|---|
| nightjar-0.1.1.tar.gz | 93.0 kB | Without provenance | Details for nightjar-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nightjar-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nightjar-0.1.1-py3-none-any.whl |
Total release size: 108.8 kB
Release files / nightjar-0.1.1.tar.gz
| Download URL | nightjar-0.1.1.tar.gz |
|---|---|
| Size | 93.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8eb7df5455850fd22a051daf62dcd00d1407b9b5971866ebed2b0cf31ebd6588
|
|
BLAKE2b-256 checksum How to use checksums |
8b145d251f63bbfa59fb3e1dc74a035ed240992415a7533b97a375685c0e4ba6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / nightjar-0.1.1-py3-none-any.whl
| Download URL | nightjar-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
792595558f8810c801ec62dd49b6f7fad1c1c172731def2b79246e883a52786b
|
|
BLAKE2b-256 checksum How to use checksums |
da59ab5a0f13f2194ace92b23da0eef5c3d5ef76587c78aab2f616fc0daa5627
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for nightjar 0.1.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.