Skip to main content

Author urirun URI flows in typed Python (Pydantic), convert to/from YAML, and run them through urirun when the runtime is installed.

Project description

urirun-flow

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • 🤖 LLM usage: $0.5160 (30 commits)
  • 👤 Human dev: ~$2928 (29.3h @ $100/h, 30min dedup)

Generated on 2026-07-05 using openrouter/qwen/qwen3-coder-next


Author urirun URI flows in a typed programming language, and convert them to/from the canonical YAML flow format — the way Pydantic gives data a typed, validated model that serializes to a schema.

A urirun flow is an ordered DAG of URI steps (query reads, command mutates), chaining prior results. The interchange format is YAML (see examples/17-flows); urirun-flow lets you build and validate that flow in code, with autocompletion, and emit the exact YAML a runner executes.

Why

YAML is great for sharing and running a flow, but a typed language gives you control: autocompletion of step references, compile-/run-time validation of the DAG, refactorability, and the ability to compute a flow (loops, conditionals, parameters) instead of hand-writing YAML. urirun-flow is the bridge — round-trip between the two.

Use (Python, Pydantic)

from urirun_flow import Flow

flow = Flow(task={"title": "Web recon"}, registry="tools.bindings.json",
            allow=["httpcheck://*", "browser://*", "log://*"])

up   = flow.step("httpcheck://host/url/query/status", id="up", payload={"url": URL})
read = flow.step("browser://chrome/page/query/dom", id="read",
                 payload={"url": URL}, after=[up])
flow.step("log://host/run/command/write", id="audit",
          payload={"detail": read.ref("text")}, after=[read])   # typed reference

print(flow.to_yaml())              # canonical urirun flow YAML
Flow.from_yaml(text)               # parse + validate back into the model

.step() returns the typed Step, so a later step references its output with step.ref("field") — a checked <id>.<field> chain rather than a magic string.

The model validates on every build: URIs are well-formed, depends_on resolves to a real step, and the graph is acyclic. kind (query/command) is derived from the URI.

CLI

urirun-flow to-yaml web_recon:flow      # import a Python flow object → YAML
urirun-flow validate flow.yaml          # DAG / deps / URIs
urirun-flow from-yaml flow.yaml         # parse + re-emit (normalize / round-trip)
urirun-flow run flow.yaml --execute     # execute through urirun when the runtime is installed

The urirun_flow import package is owned by this distribution. Typed authoring and YAML validation need only urirun-flow; execution needs the urirun runtime installed as well.

Proposal: typed flows in any language

The flow is a language-agnostic contract ({task, registry, allow, steps:[{id, uri, payload, depends_on}]}). urirun-flow is its Python (Pydantic) model; the same builder→dict mapping is implementable in any typed language and emits the identical YAML — exactly how the urirun connector SDKs stay in lockstep across languages.

js/urirun-flow.js is a runnable JS/TS emitter (typed via js/urirun-flow.d.ts) that builds the identical flow contract. make conformance builds the same reference flow in every language and asserts they agree — like make conformance for connector bindings. Verified: 2/2 emitters agree (Python + JS).

License

Licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urirun_flow-0.2.3.tar.gz (115.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urirun_flow-0.2.3-py3-none-any.whl (100.4 kB view details)

Uploaded Python 3

File details

Details for the file urirun_flow-0.2.3.tar.gz.

File metadata

  • Download URL: urirun_flow-0.2.3.tar.gz
  • Upload date:
  • Size: 115.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for urirun_flow-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c439e1c94ba6f0e6f376341aae2c2822a925759ac5d8ed798bc7628e1f3ff9de
MD5 d2bb998088540402d94102bb6d6b44c8
BLAKE2b-256 3208d1dfbd4f8990178e6b08f05fd5d4e2cb4534f5f779a24011d0c4aeb6e700

See more details on using hashes here.

File details

Details for the file urirun_flow-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: urirun_flow-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for urirun_flow-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a74670b6b2ce02fb2794ccf5600ee291af1c00b625ee1f36d80a2a3bcc4e768d
MD5 fdf2601bfb051116f72de66ddec8691d
BLAKE2b-256 1f0c55f94f8f4adc48fcc2dc655128a779403cc67fe4f48b55846484af75f300

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page