Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Corio

Corio is a practical Python toolkit for building small services, automation, data pipelines, and AI/ML support code without re-solving the same project plumbing every time.

It bundles the pieces that tend to sit between "standard library" and "application code": typed paths with serialization helpers, pydantic-friendly data models, CLI settings, structured logging spans, iterator progress, FastAPI/MCP endpoint scaffolding, release metadata generation, test environment generation, and opt-in integrations for docs, Docker, search, tabular data, PDFs, OpenAI, Home Assistant, DNS, caching, encryption, and more.

Corio is organized as one package with optional extras. Install the small core by default, then opt into the heavier tools a project actually needs.

Install

pip install corio

Examples:

pip install "corio[api]"
pip install "corio[tabular]"
pip install "corio[db.search]"
pip install "corio[infra]"

Why Use It

  • Use paths as real application objects. Read and write JSON, YAML, TOML, text, and derived paths directly from corio.Path.
  • Make CLIs from typed models. Corio builds on pydantic settings patterns so small tools can stay declarative.
  • Wrap iteration with observability. corio.iterator.Iterator tracks count, percentage, elapsed time, ETA, completion, and cleanup.
  • Expose tools as HTTP and MCP endpoints. Define endpoint classes once and mount them into FastAPI and MCP surfaces.
  • Keep release metadata generated. corio pyproject turns Corio dependency groups and project metadata into the generated pyproject.toml sections.
  • Configure generated test environments. Set test_pass_env in Corio metadata to pass selected environment variables through every generated tox test environment.
  • Install integrations only when needed. Extras keep heavy dependencies like API servers, vector search, ML, PDFs, and tabular tooling out of the base install.

Examples

Typed Paths And Data Files

from corio import Path

path = Path("runs/latest/config.yaml")
path.parent.mkdirf()
path.write_data({
    "model": "embedder-v2",
    "batch_size": 64,
})

config = path.read_data()
json_path = path.get_conversion_path("json")
json_path.parent.mkdirf()
json_path.write_data(config)

Observable Iteration

from corio.iterator import Iterator

documents = [{"id": "a"}, {"id": "b"}, {"id": "c"}]

for document in Iterator(documents):
    # Work happens inside per-item logging spans with progress stats.
    process(document)

The iterator tracks count, total, percentage, elapsed time, rate, ETA, completion logs, and closes the wrapped iterator when possible.

FastAPI And MCP Tools

from functools import cached_property

from corio import api


class Search(api.endpoint.API):
    """Search indexed documents."""

    PATH = "/search"
    TAGS = "documents"

    async def run(self, query: str):
        return {"query": query, "results": []}


class Reindex(api.endpoint.Tool):
    """Rebuild the document index."""

    async def run(self):
        return {"status": "queued"}


class Service(api.Base):
    TITLE = "Document Service"
    PORT = 8080

    @cached_property
    def ENDPOINTS(self):
        return [Search, Reindex]


Service().launch()

The same endpoint model can feed HTTP routes and MCP tools, so internal automation and external APIs stay aligned.

Project Metadata

Corio projects keep dependency intent in [tool.corio.dependencies]; generated package metadata lives in [project.optional-dependencies].

[tool.corio.dependencies]
semantic = ["sentence_transformers", "metrics"]
metrics = ["tabular", "ranx"]
tabular = ["pandas", "tabulate", "openpyxl", "odfpy", "deepdiff"]

Then regenerate:

corio pyproject

That keeps extras flattened for packaging while preserving a maintainable source-of-truth dependency graph.

Async CLI Execution

Typed CLI models expose an async run() method. Synchronous entrypoints can use launch(), while applications that already run an event loop can await run() directly. Subcommand dispatch supports both synchronous and asynchronous command implementations.

Useful Areas

  • corio.path: typed path helpers, app paths, file type guessing, serialization helpers.
  • corio.dm and corio.sets: pydantic-oriented models and settings/CLI support.
  • corio.api: FastAPI and MCP endpoint composition.
  • corio.iterator: progress-aware iterable wrapper and small collection helpers.
  • corio.infra: release, docs, tox, and pyproject generation tooling.
  • corio.db.search: vector search helpers around qdrant and embeddings.
  • corio.tabular, corio.semantic, corio.metric: data and retrieval metrics helpers.
  • corio.encrypt, corio.sec: project secret and encryption workflows.
  • corio.ha, corio.dns, corio.mqtt, corio.webhook: operations and home automation integrations.

Documentation

License

This project is licensed under Apache 2.0. See LICENSE.

Metadata

Release files for corio 2.17.18a1

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

Source distribution (sdist)

Source distribution for corio 2.17.18a1
File Size Uploaded Provenance Actions
corio-2.17.18a1.tar.gz 162.8 kB Without provenance Details for corio-2.17.18a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for corio 2.17.18a1
File Interpreter ABI Platform Actions
corio-2.17.18a1-py3-none-any.whl Python 3 none any Details for corio-2.17.18a1-py3-none-any.whl

Total release size: 360.5 kB

Release files / corio-2.17.18a1.tar.gz

Download URL corio-2.17.18a1.tar.gz
Size 162.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3685359a1c92ddd47640b9c77052b574fb02988ecd13ed67cd29560a85ce2173
BLAKE2b-256 checksum
How to use checksums
3b1b1f45599f917adb35a39e447cc888d4fbffb9288ccbeefd3dd01582ab957e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / corio-2.17.18a1-py3-none-any.whl

Download URL corio-2.17.18a1-py3-none-any.whl
Size 197.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5caa860178867640585c63fa5f76467e5235be33462f98c9da31cd97c66f719a
BLAKE2b-256 checksum
How to use checksums
da7480bb0bf54e821ff10144d5093d5fdfe87492610b180a0601dfaf02f22d42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for corio 2.17.18a1

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.

Release history Release notifications | RSS feed

This release
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