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.venvand installs deps via Poetry.test:poetry run pytest -q.run-sample: run CLI onexamples/sample_dag.json.lock: (re)generatepoetry.lockto matchpyproject.toml.patch: bump patch version via Poetry, commit, and tagvX.Y.Z.publish: push branch and tag toorigin(triggers GitHub Actions publish to PyPI).clean: remove.venvand caches.
Publishing
-
GitHub Actions workflow
Publish to PyPIbuilds 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 Versionworkflow (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 withid(string),type("function" | "tool"),name(string)edges: array of objects withsource(string),target(string), optionalcondition(string)entry_point: string (must match a nodeid)
Output LangGraph JSON (summary)
nodes: object keyed by nodeid, each with{ type, name }edges: array of{ source, target }plusconditionwhen providedentry_point: copied from input
Errors
Entry point not specified.— whenentry_pointis missing/emptyInvalid 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)
| File | Size | Uploaded | |
|---|---|---|---|
| dag2langgraph-0.1.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|