Skip to main content

Core framework

Install from PyPI as core-framework, import core_framework. MIT — LICENSE. Repository, PyPI.

Documentation

Doc Purpose
docs/README.md Doc map (platform, design, library, domains, deployments)
docs/library/package-api.md Host import surface and upgrade tables
CHANGELOG.md Release notes (SemVer)

Install

uv add core-framework

Pin hosts to a locked version. On each bump, read CHANGELOG.md and the host-upgrade tables in package-api.md.

Local development

Use Python 3.14. Install uv and Docker.

Tracked config.toml at the repo root is the local-dev settings file (dummy values; no production secrets). Production renders from config.toml.template via deploy envsubst — see architecture decisions.

docker compose -f deploy/app/docker-compose.dev.yaml up -d
uv sync --locked --all-extras --dev
uv run cf-alembic
make run

Firebase: copy firebase_config.example.json to firebase_config.json at the repo root and replace with your Firebase project’s service account JSON from the console.

For make test, install the Firebase CLI (Auth emulator) and keep Docker running for the integration containers. The testing plugin starts, waits for, and stops the emulator itself. On Windows, make test runs unit tests only, because the integration containers need Docker's Linux engine; make test-unit forces unit-only on any platform. Stop DB/Redis: docker compose -f deploy/app/docker-compose.dev.yaml down.

Pre-commit: uv sync --dev installs pre-commit. Enable hooks with uv run pre-commit install (ruff, mdformat, uv-lock, and other checks in .pre-commit-config.yaml).

Hosts

In your host app, load Settings or a Settings subclass from core_framework.core.settings, pass it to init_app from core_framework.main, then wire host-specific dependencies and routers. init_app already runs core exception handlers; host-only types use register_exception_handler.

from core_framework.main import init_app
from fastapi import FastAPI

from myapp.settings import HostSettings, load_default_settings


def build_app(settings: HostSettings | None = None) -> FastAPI:
    resolved = settings if settings is not None else load_default_settings()
    app = init_app(resolved)

    from myapp.bootstrap import configure_dependencies

    configure_dependencies(runtime=app.state.core_runtime)

    from myapp.api.router import router

    app.include_router(router)
    return app

From the host repository root, run uv run cf-alembic. See core-framework-migration.

Worker: production also runs the ARQ worker (arq core_framework.worker.main.WorkerSettings, or a host composition that calls the same startup path). Schedules and tasks: workers.md. Composition details: package-api.md (Default deployment entrypoints).

Observability: one backend per process. Under [observability], set backend to off, otlp, or logfire (local forces off). otlp needs otlp_endpoint outside local; logfire needs the LOGFIRE_TOKEN secret. otlp stack: deploy/observability/ and observability-lgtm-setup.md. Design: observability-backend-design.md. Host upgrade table: package-api.md — observability backend.

Host pytest

In your host repository, add the core-framework[testing] extra to dev or test dependencies. In tests/conftest.py, register pytest_core_framework_config (returns TestConfig) and a session-scoped anyio_backend fixture that returns "asyncio". The extra also wraps tests with Blockbuster so core_framework cannot perform stdlib blocking I/O on the asyncio loop.

import pytest

from core_framework.testing import TestConfig

from myapp.settings import load_default_settings


def pytest_core_framework_config() -> TestConfig:
    from myapp.main import build_app

    return TestConfig(
        settings_loader=load_default_settings,
        app_factory=build_app,
    )


@pytest.fixture(scope="session")
def anyio_backend() -> str:
    return "asyncio"

See Package API — Testing and testing plugin design.

Metadata

Release files for core-framework 6.0.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 core-framework 6.0.0
File Size Uploaded Provenance Actions
core_framework-6.0.0.tar.gz 2.1 MB Without provenance Details for core_framework-6.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for core-framework 6.0.0
File Interpreter ABI Platform Actions
core_framework-6.0.0-py3-none-any.whl Python 3 none any Details for core_framework-6.0.0-py3-none-any.whl

Total release size: 2.9 MB

Release files / core_framework-6.0.0.tar.gz

Download URL core_framework-6.0.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
cdb3be60e769b9f5c53116d39d40e63cb25be4f9ce8d817c9f079e6cf6bc7c18
BLAKE2b-256 checksum
How to use checksums
7e098c932b03e794276b5cd7ce93716a462e3ea9240b0f0ff9bdbedae094faf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / core_framework-6.0.0-py3-none-any.whl

Download URL core_framework-6.0.0-py3-none-any.whl
Size 781.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b6dfc041d4e9644f8153796763be10e90359c73f0682819b638cb1c61a49a9
BLAKE2b-256 checksum
How to use checksums
af36b7cfca867f8534e05ad9c83bfc5c801fdfefc87aa198f77d2cfd99211d5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 core-framework 6.0.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.

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