Function-First framework for Domain-Driven Functions — self-describing CapabilityContracts, one definition reachable from every channel, optional durable execution via Temporal.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file domaindriven-0.1.0.tar.gz.
File metadata
- Download URL: domaindriven-0.1.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a859fdaf92ff0722462b4daa85eb95aaf676913f0445e683ead2629d18d9d8c
|
|
| MD5 |
ffd6c3c87d6e35a2596de02bf8517d57
|
|
| BLAKE2b-256 |
1611d352934fd046584f293a8fea6944453a4b1dbb3a18147f37597b1d5f603c
|
Provenance
The following attestation bundles were made for domaindriven-0.1.0.tar.gz:
Publisher:
publish-domaindriven.yml on tobiasoberrauch/dde
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
domaindriven-0.1.0.tar.gz -
Subject digest:
1a859fdaf92ff0722462b4daa85eb95aaf676913f0445e683ead2629d18d9d8c - Sigstore transparency entry: 2329422515
- Sigstore integration time:
-
Permalink:
tobiasoberrauch/dde@c0d3ed4f60ccb69ea3fa1a9ae868d5864840b8c8 -
Branch / Tag:
refs/tags/domaindriven-v0.1.0 - Owner: https://github.com/tobiasoberrauch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-domaindriven.yml@c0d3ed4f60ccb69ea3fa1a9ae868d5864840b8c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file domaindriven-0.1.0-py3-none-any.whl.
File metadata
- Download URL: domaindriven-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e94e64415eba34fc96c6e70c437bba8f5f0c93f578c62b44afed30e1491606b1
|
|
| MD5 |
7eff3c5ceb0cb16bb86fa416f74ca3e4
|
|
| BLAKE2b-256 |
f5b6e43ce8772c0a339d6e2634564ebfcbe31685596fe8f013c6bb0a436857b9
|
Provenance
The following attestation bundles were made for domaindriven-0.1.0-py3-none-any.whl:
Publisher:
publish-domaindriven.yml on tobiasoberrauch/dde
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
domaindriven-0.1.0-py3-none-any.whl -
Subject digest:
e94e64415eba34fc96c6e70c437bba8f5f0c93f578c62b44afed30e1491606b1 - Sigstore transparency entry: 2329422591
- Sigstore integration time:
-
Permalink:
tobiasoberrauch/dde@c0d3ed4f60ccb69ea3fa1a9ae868d5864840b8c8 -
Branch / Tag:
refs/tags/domaindriven-v0.1.0 - Owner: https://github.com/tobiasoberrauch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-domaindriven.yml@c0d3ed4f60ccb69ea3fa1a9ae868d5864840b8c8 -
Trigger Event:
push
-
Statement type: