Skip to main content

Loom

Loom provides domain-neutral building blocks for executing tasks in flows and exploring alternative flow implementations or configurations with a Workbench. Contracts evaluate results independently of any particular domain or agent.

Installation

Conda (development)

From the repository root, create and activate the Conda environment. It installs Loom in editable mode, so source changes take effect without reinstalling:

conda env create -f environment.yml
conda activate loom

Tests

With the environment activated, run the test suite from the repository root:

python -m pytest tests

Flow

A Flow controls task sequencing, branching and repetition. Its execute() returns a FlowResult; tasks return TaskResult. Flow.repeat() runs a task until it reports no modification or reaches its iteration limit.

Workbench

A Workbench constructs flows and runs a FlowVariant, which specifies flow constructor configuration. Each Flow owns the selection and execution of its tasks.

from loom.core import Evaluation, FlowVariant, Workbench

workbench = Workbench(MyFlow)
result = workbench.run(input_value, FlowVariant(configuration={"level": 2}))

# strategy.propose(previous_evaluation) returns a FlowVariant.
# evaluator returns Evaluation(accepted=..., result=result, feedback=...).
result = workbench.explore(input_value, strategy, evaluator=evaluator,
                           max_attempts=5)

Without an evaluator, a run is accepted when it returns successfully. Execution exceptions are passed to the strategy as failed Evaluation feedback. After exhausting attempts, AttemptsExhausted.evaluation retains the last outcome. An input_factory can supply fresh input for each run when flows mutate inputs.

Contracts

Contract, ContractResult, ContractException, and Verifier are available from loom.core. Contracts evaluate results; the verifier collects failures and raises ContractException when a check fails.

Example

See examples for a mock flow and a Workbench running multiple configurations.

Metadata

Release files for loom-workflow 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loom-workflow 0.9.1
File Size Uploaded Provenance Actions
loom_workflow-0.9.1.tar.gz 7.7 kB Without provenance Details for loom_workflow-0.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loom-workflow 0.9.1
File Interpreter ABI Platform Actions
loom_workflow-0.9.1-py3-none-any.whl Python 3 none any Details for loom_workflow-0.9.1-py3-none-any.whl

Total release size: 15.4 kB

Release files / loom_workflow-0.9.1.tar.gz

Download URL loom_workflow-0.9.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
48e430b9dce88ff8c860ef3977146f25620997e9a9edbeb44a41f7d577990185
BLAKE2b-256 checksum
How to use checksums
63a1b6b7da30ee35993e17cbe9218a65a8790eaa803a125f2cedaf653ead3ae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / loom_workflow-0.9.1-py3-none-any.whl

Download URL loom_workflow-0.9.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a95820ad12a675fe3336b93cce729a80d520432519c451078783716d24554487
BLAKE2b-256 checksum
How to use checksums
2234bca806457255df64eb2844087f081a3e815b0bc42f42ffdb09fb9c9692f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for loom-workflow 0.9.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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