Skip to main content

Asynchronous, Type-Safe Python Pipeline Framework

Project description

Chorey: The Asynchronous, Type-Safe Python Pipeline Framework 🚀

Chorey is a modern, lightweight, and highly testable framework for building complex data and control flows in Python. It allows you to chain asynchronous functions, manage shared state, implement conditional routing, and handle concurrency, all while preserving end-to-end type safety.

Key Features ✨

  • Asynchronous by Design ⚡️: Built on asyncio for efficient, non-blocking I/O-bound tasks.
  • Intuitive Chaining 🔗: Construct complex workflows using a fluent .next() API.
  • Advanced Control Flow 🚦: Built-in support for concurrent execution (.branch()) and conditional logic (.route()).
  • Resilience 🛡️: Configure automatic retries and custom failure callbacks for any step.
  • Type Safety ✅: Chorey's biggest selling point: enforces strict type contracts between all pipeline stages.
  • Visualization 📊: Automatically generate Mermaid diagrams for visual inspection and debugging.

Quick Start 🏁

Installation 🛠️

pip install chorey
# or with cli tools
pip install chorey[cli]

Example Pipeline 🧑‍💻

Define a pipeline by chaining asynchronous functions with the step factory:

from chorey import step
from dataclasses import dataclass
import asyncio

@dataclass
class User:
    id: int
    name: str

async def fetch_user(user_id: int) -> User:
    # Simulate API call
    return User(id=user_id, name="Jane Doe")

async def welcome_user(user: User) -> str:
    return f"Welcome, {user.name}!"

# Define the pipeline chain
pipeline = step(fetch_user).next(welcome_user)

if __name__ == "__main__":
    result = asyncio.run(pipeline.feed(42))
    print(result) # Output: Welcome, Jane Doe!

Documentation 📚

For comprehensive guides on shared context, routing, branching, and CLI usage, please visit the Official Chorey Documentation. Currently the code documentation is not reliable, so please refer to the docs for the most accurate information.

Roadmap 🛤️

This is the first iteration of Chorey. Other than documentation, I do not have more plans yet, as I am currently collecting feedback. If you have any feature requests or ideas, - until I set up a more formal process on GitHub - please email me.


© 2025 anwitars | Licensed under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chorey-0.1.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chorey-0.1.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file chorey-0.1.0.tar.gz.

File metadata

  • Download URL: chorey-0.1.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for chorey-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6fdc43be97a5db33195db713774ae44816e54d2abb90d90f57ac9bfc1c05e1cc
MD5 7cc02bd7c7cb6445eef1cbbe31480a6c
BLAKE2b-256 0ca3a487d1cf223bfef631d39ba14a7629314bcc36f60bb5d8064cb9326dd627

See more details on using hashes here.

File details

Details for the file chorey-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chorey-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for chorey-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75442bc79250ec2ce88d6fa5e4dcafa7931d92b9e28ddba898bdd9b5bde4370e
MD5 50202181b3bc56f01f44623083742310
BLAKE2b-256 e10c4441363eb06b5113b016e51a2e477c80adb32d313f2a56cf69ef1fc9ce6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page