# tabatkins/railroad-diagrams

:steam_locomotive: A small JS+SVG library for drawing railroad syntax diagrams, like on JSON.org. Now with a Python port!

Repository: https://github.com/tabatkins/railroad-diagrams
Canonical: https://ross.abutalabs.com/products/railroad-diagrams
Language: Python
License: MIT
License Family: permissive
Last push: 2026-05-11T21:12:58+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 81, release rhythm 35, longevity 100
- inputs: {"age_days": 5106, "days_push": 114, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1762, forks 158 (observed 2026-08-28T04:05:32.795914+00:00)

## What it is
A small JS and Python library for generating railroad (syntax) diagrams as SVG or Unicode text, like those on JSON.org. It visually represents grammars in a more readable form than regular expressions or BNF.

## Use cases
- generate railroad diagrams for a language grammar
- visualize BNF grammar as syntax diagrams
- create SVG syntax diagrams like JSON.org
- render grammar diagrams as unicode text
- document a DSL with syntax diagrams
- embed railroad diagrams in documentation

## When to choose
- you need attractive SVG railroad diagrams for a grammar
- you want both JavaScript and Python support
- you need text-based (unicode) diagram output as well

## When to avoid
- you need diagrams that auto-size precisely to long text labels
- you need interactive or editable diagram tooling
- you need general-purpose charting or graph visualization

## Facets
- artifact type: library
- maturity: stable
- function: graphics, documentation, parser
- domain: documentation, parsers, developer-tools, web-development
- platform: python, cross-platform
- tags: railroad-diagrams, svg, syntax-diagrams, grammar-visualization, unicode-text-diagrams, nodejs

## Member repositories
- tabatkins/railroad-diagrams (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:32.795914+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:27:02.744393+00:00, confidence not recorded.
  - readme: https://github.com/tabatkins/railroad-diagrams (fetched 2026-08-28T04:05:32.795914+00:00, sha e6a489f0cbb7)
  - registry_pypi: https://pypi.org/pypi/railroad-diagrams/json (fetched 2026-08-29T11:05:19.023361+00:00, sha 37b04bff1802)
- Data as of 2026-08-30T08:39:29.467469+00:00.
