Skip to main content

ofplang export

CI PyPI

Readable views of ofplang documents: a workflow as its dataflow graph, and the execution plans ofp-schedule produces from it, shown side by side and linked — as a web site, and as one self-contained HTML file. The viewer is OFP View (OFP: Object-Flow Programming).

It reads the documents the ofplang specifications define and nothing more, so it does not depend on any dialect built on top of them.

pip install ofplang-export
ofp-export view plan.yaml -o plan.html        # a plan; its workflow and environment come from its meta
ofp-export view workflow.yaml -o wf.html      # a workflow on its own

ofp-export view writes the viewer as one HTML file with the documents in it, to open from disk or send to someone. It is also meant to be reachable as ofp export view and, under labcode, lc export view.

→ ofplang.github.io/export — eleven plans are bundled (one of them, data_flow, curated here: Pure Data, and an entry with inputs and outputs); ?doc=plate_batch opens one directly. Drop your own YAML on the window to read that instead: a plan, a workflow, an environment, or all three at once. A workflow on its own is fine — the graph does not need a plan to be read. Either pane can take the whole window: Both / Workflow / Plan in the top bar, or &layout=workflow / &layout=plan in the address.

The point is to be able to hand someone a URL. They open it and see the dataflow graph and the Gantt chart of a plan side by side, linked: pick a bar and the workflow node it came from lights up, pick a node and every bar under it lights up. No install, no server, no Python.

Status: early but usable. Both panes work and are linked: pick a bar and the workflow box it came from lights up, pick a box and everything under it lights up in the plan. Plans can be exported as SVG or put in a link. prototype/ holds the single-file look-and-feel study the visual decisions were made against.

The command

ofp-export view <file>... [-o OUT] [--layout split|workflow|plan] [--gantt device|flow|activity]
                          [--name NAME] [--no-follow] [--json]
  • Files are a plan, a workflow and/or an environment, in any order; which is which is read from the file. A plan's meta supplies the workflow and the environment unless they are given (--no-follow turns that off).
  • Without -o the HTML goes to standard output, as ofp-schedule does with a plan. With -o the path written is printed; --json prints a summary instead.
  • Exit codes: 0 written (warnings, if any, on stderr — parts of a workflow the viewer shows only as source structure), 2 bad input, 3 refused and nothing written — a joint plan (several workflows scheduled together as jobs), which this viewer does not draw.

skills/ofp-export/SKILL.md says the same for an agent calling the command, as a skill to install where the agent looks for them.

A single file

The same viewer also builds as one self-contained HTML file that carries its documents inside it: open it from disk, no server, nothing beside it. npm run build:single writes the empty template, web/dist-single/viewer.html (also kept as the viewer-template artifact of every CI run), and web/scripts/embed.mjs puts documents into it:

node scripts/embed.mjs dist-single/viewer.html out.html plan.yaml --workflow w.yaml --env e.yaml

The documents go in as the YAML text as written, in one element — <script type="application/json" id="ofp-documents" data-contract="1"> — and the page reads them with the same reader it uses for a dropped file. An empty template (null in that element) is an offline viewer to drop files on. The web fonts stay a link, so offline the page falls back to system fonts; Copy link is hidden, since a link made from a file on disk would point at the disk.

Layout

Path What it is
web/ the application — Vite + TypeScript, no runtime dependency beyond yaml
web/src/model/ types for the workflow, the environment and the execution document
web/src/read/ YAML → those types; the only part that tracks the specifications
web/src/model/scene.ts the indices every view is built on — by node, by arc, by machine
web/src/layout/ lanes, bars and the time scale; pure functions, no DOM
web/src/view/ SVG rendering, the inspector, and the SVG export
web/scripts/collect-datasets.mjs turns the submodule's examples into the bundled datasets
web/scripts/build-single.mjs folds the build into the one-file viewer template
web/scripts/embed.mjs puts documents into that template — the contract, in one place
ofplang/export/ the ofp-export Python package; template.py is the same contract in Python
tests/ its tests (pytest), against the pinned submodule's examples
web/tests/golden/ every example the pinned submodule ships must read
external/ofplang-schedule submodule, pinned by tag — specifications and examples
prototype/ a single-file look-and-feel study; not the codebase
web/public/favicon.png the ofplang mark, from ofplang/spec logos/symbol-circle.png; the SVG version is inline in web/index.html

Why a TypeScript reader instead of reusing the Python one

The sibling repositories own the specifications and the semantics, and this one does not modify them. It also has to run with nothing installed on the viewer's machine, which rules out a Python pre-processing step. So the document readers here are a deliberate, bounded re-implementation of two stable schemas — SPECIFICATIONS.md §5 (environment) and §6 (execution document) — kept honest by the golden test against the pinned submodule's own examples.

Anything outside that subset — $import, generics, structured nodes, and joint plans that schedule several workflows together as jobs — is refused rather than guessed at.

Working on it

git clone --recurse-submodules git@github.com:ofplang/export.git
cd web
npm install

npm run dev        # development server (collects the datasets first)
npm run datasets   # rebuild public/datasets/ from external/
npm run typecheck  # tsc --noEmit
npm test           # golden tests against external/ofplang-schedule
npm run build      # typecheck + production build into web/dist
npm run build:single  # …and the one-file template into web/dist-single
npm run test:e2e   # the browser tests (builds the template first)

The Python package, from the repository root (after npm run build:single, which also puts the template into ofplang/export/_template/):

pip install -e ".[dev]"
pytest

A release is a v* tag: publish.yml builds the template and the wheel from the same commit and publishes through PyPI trusted publishing (an rc tag goes to TestPyPI). Installing straight from git gives no template — it is built, not committed — and the command says so.

Already cloned without --recurse-submodules? git submodule update --init.

License

MIT — see LICENSE.

Metadata

Release files for ofplang-export 0.1.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 ofplang-export 0.1.1
File Size Uploaded
ofplang_export-0.1.1.tar.gz 82.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ofplang-export 0.1.1
File Interpreter ABI Platform
ofplang_export-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 153.2 kB

Release files / ofplang_export-0.1.1.tar.gz

Download URL ofplang_export-0.1.1.tar.gz
Size 82.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9986b330f21802c81da6b8b80bf358babddb1858c637b94fd7a0a0e53806538e
BLAKE2b-256 checksum
How to use checksums
fe31a0385f786b6946f4592288990b83f8bc677b41b65955502199ae496fe2cd
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 Sep 27, 2026.

Transparency log

Release files / ofplang_export-0.1.1-py3-none-any.whl

Download URL ofplang_export-0.1.1-py3-none-any.whl
Size 70.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6febf45b03d7856229b1e3f98974a122053dd5512437d3bd3e495a5803982aea
BLAKE2b-256 checksum
How to use checksums
e6db24f8d8d2a7054bf1ba722278d8d2ab089aead217e252c4d0f1040cc690da
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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

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