Skip to main content

capsize-commons (Python)

The Python distribution of capsize-commons. It has no required dependencies; each sub-package is pulled in through an extra and imports its third-party dependency lazily, so importing one module never drags in another module's stack.

Install

uv add "capsize-commons[logging]"        # anything is optional
uv add "capsize-commons[web,db,config]"  # or pick several
uv add "capsize-commons[all]"            # or everything
Extra Enables Third-party
config capsize_commons.config pydantic, pydantic-settings
db capsize_commons.db sqlalchemy
web capsize_commons.web fastapi
http capsize_commons.http none (stdlib only)
all every sub-package above

capsize_commons.text and capsize_commons.logging are stdlib-only and ship with the base install.

Modules

# Structured JSON logs matching §14
from capsize_commons.logging import configure_logging
configure_logging(json_mode=True, logger_name="myapp")

# Env-backed settings, cached per class
from capsize_commons.config import CapsizeSettings, get_settings
class Settings(CapsizeSettings):
    model_config = CapsizeSettings.model_config | {"env_prefix": "MYAPP_"}
    database_url: str = "sqlite:///./app.db"

# FastAPI auth + health
from capsize_commons.web import make_api_key_dependency, install_health_routes

# SQLAlchemy engine, sessions and the standard model mixin
from capsize_commons.db import make_engine, make_session_factory, TimestampedBase

# HTTP retry with backoff
from capsize_commons.http import Backoff, retry_async

# Naming (§3.1)
from capsize_commons.text import slugify, to_snake_case

Development

cd python
uv sync --all-extras
uv run pytest
uv run ruff check . && uv run ruff format --check .
uv run mypy src

Or from the repository root: just test, just lint, just typecheck.

Metadata

Release files for capsize-commons 0.1.2

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

Source distribution (sdist)

Source distribution for capsize-commons 0.1.2
File Size Uploaded
capsize_commons-0.1.2.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capsize-commons 0.1.2
File Interpreter ABI Platform
capsize_commons-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.5 kB

Release files / capsize_commons-0.1.2.tar.gz

Download URL capsize_commons-0.1.2.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b7be57a0c12e28e4dfd81d7588d5d5355313b9b8cf363652e2ffa38bd374fea2
BLAKE2b-256 checksum
How to use checksums
51d1c18b2c97b6b2405760e2101870931c589eeeb6332ba77c7ae8b4ff68f670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / capsize_commons-0.1.2-py3-none-any.whl

Download URL capsize_commons-0.1.2-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3ef1714513ec54e60fea3b72457f9604b17f0458150fb8e82718ecb34065e11
BLAKE2b-256 checksum
How to use checksums
bc81443fde491710455ec92b0217e67d7dcfe6f2a6fa36085004a6b0c4c50af9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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