Skip to main content

Python toolkit for the General Modeling Network Specification (GMNS). Fast I/O at regional scale (parquet/duckdb/zip/URL), foreign-key validation with out-of-sync awareness, geographic + network-aware scoping, data-quality checks, network editing with atomic rollback, and a CLI + notebook + programmatic API.

Project description

GMNSpy

Python toolkit for the General Modeling Network Specification (GMNS) — Zephyr Foundation's open standard for routable transportation network data.

Status: v1.0 in development on refactor/v1.0. See docs/PRD.md for the product requirements document.

What it provides

  • Read/write GMNS networks from CSV, Parquet (partitioned), DuckDB, zipped CSV, or remote URLs (with credentials).
  • Validation — schema, structural, foreign-key, sync-state (out-of-sync awareness on write), and configurable data-quality rules.
  • Network-aware scoping — bbox, polygon, BFS / shortest-path subgraph, network-distance buffer, spatial buffer from any link/point/node.
  • Editing (gmnspy[clean]) — simplify geometry, merge close nodes, snap to reference, etc., with atomic rollback + audit log.
  • Self-hostable API server (gmnspy[server]) — FastAPI + auto-OpenAPI for spinning up your own GMNS data service.
  • AI accessibility (gmnspy[mcp]) — MCP server entry point; Skills in the monorepo skills/ directory.
  • CLI, notebook, and programmatic API — same operations, three surfaces.

Install

Pick the tool you already use — these are equivalent:

# uv (recommended — fastest, handles workspace projects + lockfiles)
uv add gmnspy

# uv pip (drop-in pip replacement, no project file needed)
uv pip install gmnspy

# pip (classic)
pip install gmnspy

# pipx (CLI-only, isolated env; gives you the `gmnspy` command without
#       polluting your project env)
pipx install gmnspy

datagrove comes along automatically — you don't install both.

Optional extras

uv add 'gmnspy[osm]'          # build a GMNS network from OpenStreetMap (requests + pyyaml)
uv add 'gmnspy[clean]'        # network editing + cleanup (shapely + igraph + pyproj)
uv add 'gmnspy[server]'       # self-hostable HTTP server (FastAPI + uvicorn)
uv add 'gmnspy[mcp]'          # MCP server for Claude Desktop / Code
uv add 'gmnspy[notebook]'     # scope-builder Jupyter widget (ipywidgets)
uv add 'gmnspy[all]'          # everything above

Combine extras with commas: uv add 'gmnspy[clean,server,mcp]'.

Note: the basic _repr_html_ for Network / ValidationReport / EditResult works without [notebook] — that extra only adds the interactive scope-builder widget.

Quickstart

import gmnspy
from gmnspy.fixtures import leavenworth     # bundled example network

net = gmnspy.read(leavenworth.csv_dir())     # auto-detects format
report = gmnspy.validate(net)                # schema + FK + data-quality
print(report)                                # rich console
# report.to_html("report.html")              # writes interactive single-file HTML

# Network-aware scope: BFS subgraph + half-mile network buffer
# sub = net.scope.from_nodes([1, 2, 3], path_between=True).buffer_network("0.5mi")
# sub.write("subset.parquet")

Repo

Developed in the GMNSpy monorepo under packages/gmnspy/.

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

gmnspy-1.0.0b1.tar.gz (202.4 kB view details)

Uploaded Source

Built Distribution

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

gmnspy-1.0.0b1-py3-none-any.whl (290.4 kB view details)

Uploaded Python 3

File details

Details for the file gmnspy-1.0.0b1.tar.gz.

File metadata

  • Download URL: gmnspy-1.0.0b1.tar.gz
  • Upload date:
  • Size: 202.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmnspy-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 febeb1b8b3d5b3d9cfa7c9dca9705c0e67b063d736e978889e4bd84c0b2dc778
MD5 502e6580f9c8eea7f31e6376a5fff315
BLAKE2b-256 20aedcd9ef9b9958fe67385e3c5f9769199af2ad9a32786b6f54186994830c4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmnspy-1.0.0b1.tar.gz:

Publisher: publish-gmnspy.yml on e-lo/GMNSpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmnspy-1.0.0b1-py3-none-any.whl.

File metadata

  • Download URL: gmnspy-1.0.0b1-py3-none-any.whl
  • Upload date:
  • Size: 290.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmnspy-1.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 1455d36e3efd1c62ed22cd8f3a05ff2ca4e362802afea9a04dd7c0c6dc03393e
MD5 5c08741797d7f020d456de2432d7e529
BLAKE2b-256 52e68b42d81aa75e348b640011d0f971280f8b807b945a8a5030a9e46f00598c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmnspy-1.0.0b1-py3-none-any.whl:

Publisher: publish-gmnspy.yml on e-lo/GMNSpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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