Skip to main content

domaindriven

Function-First framework for Domain-Driven Functions — the DDF pillar of Domain-Driven Enterprise.

A function is the smallest self-describing unit of capability. You declare it once as a CapabilityContract (what it does, its invariants, who may call it, which domain events it emits), and it becomes reachable from every channel — REST, CLI, an LLM tool, a UI, a cron — through one invoke(). The execution substrate is swappable: in-process by default, or durable via Temporal without changing a single caller.

Core has zero required dependencies (stdlib only). YAML and Temporal are optional extras.

Install

pip install domaindriven                 # core
pip install "domaindriven[yaml]"         # + catalog YAML export / round-trip
pip install "domaindriven[temporal]"     # + durable execution via Temporal
pip install "domaindriven[all]"

Hello, function

from domaindriven import FunctionSpec, Param, register, invoke

def _handler(args, ctx):
    return {"greeting": f"Hallo {args['name']}"}

register(FunctionSpec(
    id="demo.greet", description="Grüßt eine Person", category="DEMO",
    returns="greeting", handler=_handler,
    params=[Param(name="name", type="string", required=True)],
    # — optionaler Capability-Contract (DDF/DDI/DDG) —
    bounded_context="Demo", decision="deterministic",
    invariants=("verändert keinen Zustand",), emits=("PersonGreeted",),
))

print(invoke("demo.greet", {"name": "Welt"}))
# {'ok': True, 'greeting': 'Hallo Welt', 'fx': {'id': 'demo.greet', 'worker': 'inline', ...}}

What you get

Modul Zweck
core Registry, CapabilityContract (FunctionSpec), register, invoke, Policy (Permission/Params)
worker austauschbares Ausführungs-Substrat (InlineWorker/ThreadWorker, set_worker)
loader load_package("meine_app") — Auto-Discovery selbst-registrierender Module
process ProcessSpec — Prozesse als Komposition von Funktionen (input/action/gate/view)
service HTTP-Worker (serve([...])) — REST-Kanal für die Registry
catalog JSON/YAML-Export, Traceability-Matrix, YAML→Contract Round-Trip
schema JSON-Schema (Editor-Autocomplete) + Scaffold-Template
naming durchsetzbares Namensschema (Linter)
temporal_adapter durable execution: TemporalWorker (Function→Activity, Process→Workflow)

Durable execution (optional)

from domaindriven import set_worker
from domaindriven.temporal_adapter import TemporalWorker
from temporalio.client import Client

client = await Client.connect("localhost:7233")
set_worker(TemporalWorker(client, "my-queue"))   # ab jetzt läuft jedes invoke() durable

Function → Activity (Retry/Timeout aus dem Contract), ProcessSpec → Workflow (gate→Signal, view→Query). Der PTDS-Kern passt exakt zu Temporals Determinismus-Grenze: decision="ai_assisted" gehört zwingend in eine Activity.

Status

Teil des dde-Monorepos. Alpha — API kann sich noch ändern.

Metadata

Release files for domaindriven 0.1.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 domaindriven 0.1.0
File Size Uploaded
domaindriven-0.1.0.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for domaindriven 0.1.0
File Interpreter ABI Platform
domaindriven-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.0 kB

Release files / domaindriven-0.1.0.tar.gz

Download URL domaindriven-0.1.0.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a859fdaf92ff0722462b4daa85eb95aaf676913f0445e683ead2629d18d9d8c
BLAKE2b-256 checksum
How to use checksums
1611d352934fd046584f293a8fea6944453a4b1dbb3a18147f37597b1d5f603c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release files / domaindriven-0.1.0-py3-none-any.whl

Download URL domaindriven-0.1.0-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e94e64415eba34fc96c6e70c437bba8f5f0c93f578c62b44afed30e1491606b1
BLAKE2b-256 checksum
How to use checksums
f5b6e43ce8772c0a339d6e2634564ebfcbe31685596fe8f013c6bb0a436857b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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