universal-chain-ontology (UCO)
The standalone Link / Chain homoiconic composition primitives — the chain substrate that a lot of systems reimplement. Pure stdlib, zero dependencies.
from uco import Link, Chain, LinkResult, LinkStatus
class Inc(Link):
async def execute(self, context=None, **_):
ctx = dict(context or {}); ctx["n"] = ctx.get("n", 0) + 1
return LinkResult(status=LinkStatus.SUCCESS, context=ctx)
# a Chain IS a Link (homoiconic) — so Chains nest like any other Link
import asyncio
out = asyncio.run(Chain("two", [Inc(), Inc()]).execute({"n": 0}))
assert out.context["n"] == 2
What's here
| primitive | what it is |
|---|---|
Link |
ABC: execute(context) -> LinkResult |
Chain |
sequential composition of Links; a Chain IS a Link |
EvalChain |
a Chain + an evaluator loop (gate to a condition / max_cycles) |
Compiler |
a Chain whose output is itself a Link |
ConfigLink / LinkConfig |
config-driven Links |
LinkResult / LinkStatus |
the result + status enum (SUCCESS/BLOCKED/ERROR/AWAITING_INPUT) |
Why standalone
The same Link/Chain abstraction was living inside SDNA and getting copy-pasted into other projects. UCO is
that abstraction extracted once. Downstreams import uco; sdna.chain_ontology re-exports it, so existing
from sdna.chain_ontology import Link, Chain, … keeps working unchanged and the class identity is shared
(one Link everywhere).
MIT.
Metadata
Release files for universal-chain-ontology 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| universal_chain_ontology-0.1.0.tar.gz | 8.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| universal_chain_ontology-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / universal_chain_ontology-0.1.0.tar.gz
| Download URL | universal_chain_ontology-0.1.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0b19e33ffa26fbd2dc0911e8e656ff3407b55ea2f32245969b19eddf2943367
|
|
BLAKE2b-256 checksum How to use checksums |
1b79598cc51771a11462b126a9f42e8846bb459df74aa0de670adbf0b8c999de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / universal_chain_ontology-0.1.0-py3-none-any.whl
| Download URL | universal_chain_ontology-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
231b3d5f6326c1bf568958d55f4ce850aa85928dfdf1c3f69b8942d85ac10b91
|
|
BLAKE2b-256 checksum How to use checksums |
b5c01df4443b1cc4e7acf44e3a2635d5bd37f4c8bcaba06b32657f48827ee3dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for universal-chain-ontology 0.1.0
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.