csrd-models
Shared Pydantic models, settings, and parsing utilities for FastAPI microservices.
Package: csrd.models · Import: from csrd.models import BaseModel, BaseSettings
What's included
BaseModel/BaseSettingswith camelCase alias config andpopulate_by_name=TrueModelParserMixin— response parsing mixin for delegates and repositoriesPayloadExtractor/DefaultExtractor— pluggable payload extractionUserClaims— JWT user claims dataclassAPIErrorResponse,ErrorMeta,Error,APIVersion— structured error response modelsSecret/InternalToken— settings field marker that refuses to boot on empty, short or placeholder secrets
Secret settings
from typing import Annotated
from csrd.models import BaseSettings, InternalToken, Secret
class Settings(BaseSettings):
internal_token: InternalToken = "" # Annotated[str, Secret()] — min 32 chars
db_password: Annotated[str, Secret(min_length=16, placeholders=("dev-password",))] = "change_me"
Secret(min_length=32, placeholders=(), markers=DEFAULT_PLACEHOLDER_MARKERS)
rejects empty/whitespace values, values containing a marker (change_me,
changeme, change-me, <generate; case-insensitive), any declared
placeholder, and values shorter than min_length. It works on str and
SecretStr; None passes through for str | None fields. Validation runs when
settings load (pydantic-settings validates defaults), and a single
ValidationError lists every offending field. BaseSettings sets
hide_input_in_errors=True, so rejected values never appear in the error.
Installation
uv pip install "csrd-models @ git+ssh://git@github.com/csrd-api/fastapi-common.git#subdirectory=packages/models"
Dependencies
None (Tier 1 — standalone)
Metadata
Release files for csrd-models 0.7.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 | |
|---|---|---|---|
| csrd_models-0.7.0.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csrd_models-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / csrd_models-0.7.0.tar.gz
| Download URL | csrd_models-0.7.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3f2a210a72e4af2d6e298752f834bed13a11030797dcadc9cacb89d037a5e64
|
|
BLAKE2b-256 checksum How to use checksums |
fc9bcd3cb71569ea039862e784ac71620d7d88f9021cbe207c2bcfe643415d10
|
| 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 16, 2026.
Transparency logRelease files / csrd_models-0.7.0-py3-none-any.whl
| Download URL | csrd_models-0.7.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d82d4e7ce1bc1a35fdc8102b2bd8cb58ec728ca9f1681f8c05c5a6fc6a43e468
|
|
BLAKE2b-256 checksum How to use checksums |
0a9e223716f36c7c0a0fe2f8f4213b56c499dd5be1f5f964e35d48a5b46d92a3
|
| 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 16, 2026.
Transparency log