Skip to main content
Cloacina Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Python Examples

Python Examples

Worked end-to-end examples for the Cloaca Python bindings.

Available examples

  • Basic Workflow — a complete end-to-end example: define tasks with @cloaca.task, build a workflow, run it via DefaultRunner.execute(), and inspect the result.

Looking for more?

The example library here is intentionally small. For broader coverage, use the dedicated tracks:

  • Python Tutorials — the step-by-step learning path: first workflow, context handling, complex workflows, error handling, multi-tenancy, cron scheduling, event triggers, packaged workflows, computation graphs, accumulators.
  • Python How-To Guides — task-oriented recipes: testing workflows, performance optimization, packaging Python workflows, backend selection.
  • Python API Reference — the full surface for cloaca’s decorators, types, and runner configuration.
  • The repo’s examples/tutorials/python/ directory — runnable sources for every Python tutorial, kept in lockstep with the prose.

If you need an example that isn’t covered by any of the above, opening an issue with the use case is the most direct path to a new tutorial or guide.

Prerequisites for running examples

# Install Python bindings
pip install cloaca[sqlite]    # or cloaca[postgres]
import cloaca

# SQLite for development
runner = cloaca.DefaultRunner("sqlite:///examples.db")

# PostgreSQL for production
runner = cloaca.DefaultRunner("postgresql://user:pass@localhost:5432/cloacina")