Skip to main content

dag2langgraph

Compiles a DAG JSON into LangGraph JSON. Includes validation for structure and cycles.

Install / Run (Poetry)

  • Ensure Poetry is installed: https://python-poetry.org/docs/#installation
  • Create an in-project virtualenv and install deps (creates .venv):
    • make setup
  • Run tests:
    • make test
  • Convert a DAG file via console script:
    • poetry run dag2langgraph examples/sample_dag.json -o /tmp/langgraph.json
  • Or via stdin/stdout:
    • cat examples/sample_dag.json | poetry run dag2langgraph - > /tmp/langgraph.json

Makefile Targets

  • setup: creates/uses .venv and installs deps via Poetry.
  • test: poetry run pytest -q.
  • run-sample: run CLI on examples/sample_dag.json.
  • lock: (re)generate poetry.lock to match pyproject.toml.
  • patch: bump patch version via Poetry, commit, and tag vX.Y.Z.
  • publish: push branch and tag to origin (triggers GitHub Actions publish to PyPI).
  • clean: remove .venv and caches.

Publishing

  • GitHub Actions workflow Publish to PyPI builds and uploads the package when:

    • A GitHub Release is published, or
    • You push a tag like v0.1.0, or
    • You manually dispatch the workflow.
  • Required secret in the repo settings:

    • PYPI_API_TOKEN: PyPI API token (user: __token__).

Releasing (Patch)

  • Use the Release Patch Version workflow (workflow_dispatch) to:
    • Bump the patch version via Poetry
    • Commit the change and create tag vX.Y.Z
    • Create a GitHub Release
    • This will trigger the publish workflow to upload to PyPI

Input DAG schema (summary)

  • nodes: array of objects with id (string), type ("function" | "tool"), name (string)
  • edges: array of objects with source (string), target (string), optional condition (string)
  • entry_point: string (must match a node id)

Output LangGraph JSON (summary)

  • nodes: object keyed by node id, each with { type, name }
  • edges: array of { source, target } plus condition when provided
  • entry_point: copied from input

Errors

  • Entry point not specified. — when entry_point is missing/empty
  • Invalid DAG structure or cycles detected. — for malformed fields, missing refs, duplicate ids, or cycles

Metadata

Release files for dag2langgraph 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 dag2langgraph 0.1.1
File Size Uploaded
dag2langgraph-0.1.1.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 9.8 kB

Release files / dag2langgraph-0.1.1.tar.gz

Download URL dag2langgraph-0.1.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1908b7e7923e223c658f865956a5179306be2826f576679df43d35dbb14d9e1
BLAKE2b-256 checksum
How to use checksums
f23e2b9fa899b2a06543b0a40ef4b8e2ef384bb88160bde032336622bbcd8559
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

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

Download URL dag2langgraph-0.1.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ecedc261847d1ed666f317a34c8a923fde931869d8b246f318941937c19685c
BLAKE2b-256 checksum
How to use checksums
48c0a00981ab569b9d429788576c3039b7f2d1ff18ce1ad615ce79d2d4d42834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

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