Skip to main content

IduEdu

Code style: black PyPI version Tests and Coverage Coverage License Docs GitHub

IduEdu logo banner

IduEdu is an open-source Python toolkit for building and analysing multimodal city networks from OpenStreetMap and local GTFS Schedule data. It reads OSM data from Overpass or local .osm.pbf files and GTFS feeds, builds drive, walk, bike, public-transport and intermodal networks, and stores them as UrbanGraph objects backed by GeoDataFrame node and edge tables. Routing, network statistics, accessibility sums and centralities run in a compiled Rust core.

Benchmark snapshot

The benchmark below isolates city-scale pedestrian graph construction, comparing IduEdu's tabular UrbanGraph representation with OSMnx's widely used NetworkX-backed workflow on the same area of interest for each city. Both simplification modes are shown because simplify changes the trade-off between graph-construction time and the size of the resulting graph.

Pedestrian graph construction benchmark

Across these repeated B1 runs, IduEdu built pedestrian graphs in about 6.6-10.0x less time without simplification and 3.9-6.7x less time with simplification enabled. The resulting geospatial graph object had a 10-12x lower deterministic representation-size estimate. Edge-row counts are shown as a representation detail: UrbanGraph can keep bidirectional walking edges as one row with a direction flag, while NetworkX-style directed multigraphs store separate directed edge rows.

These runs were measured with IduEdu 2.x; full protocol notes, limitations and raw-result links are in the 2.x benchmark documentation. Measurements of the Rust core of 3.0 will follow on the performance page.

Documentation

Full documentation is published at https://iduclub.github.io/IduEdu/. Upgrading from 2.x? See Upgrading to 3.0; the graph model is described in The UrbanGraph model. Runnable examples are available for graph construction, UrbanGraph basics, object projection, shortest paths, routing methods, network analysis and elevation and cycling. GTFS feeds are covered in the GTFS guide and the GTFS example, public-transport speeds and waits in the public-transport guide, and every setting in the configuration guide.

Features

  • Store graph topology, geometry, CRS and edge weights in UrbanGraph, a GeoDataFrame-native graph model.
  • Build drive, walk and bike graphs from OpenStreetMap with local metric projection and optional simplification; bike edges carry their cycling infrastructure and level of traffic stress.
  • Build static public-transport graphs directly from OSM relations for bus, trolleybus, tram, subway, monorail and share taxi, with trains available through DEFAULT_REGISTRY_W_TRAIN.
  • Build static public-transport graphs from local GTFS Schedule directories or ZIP archives, using timetable headways for boarding weights and shapes or straight-line fallbacks for route geometry. Several feeds of one city can be merged with merge_gtfs_feeds.
  • Reconstruct shortest routes as ordered nodes and edge geometries for mapping.
  • Combine pedestrian and public-transport layers into one intermodal graph by projecting stops, platforms and station access points onto the walking network.
  • Compute shortest paths and OD matrices with CSR routines written in Rust, cutoff thresholds and adaptive graph reversal for unbalanced origin-destination sets.
  • Find routes between two points with bidirectional search, A* or ALT landmarks, alternative routes by the penalty method and the k shortest routes.
  • Measure networks: statistics by area, zone or node surroundings, the nearest objects, sums and diversity of objects within a travel cost, reach, closeness, gravity and betweenness centralities.
  • Add heights and grades from a raster, spot heights or contours, and make travel times depend on the slope.
  • Work with connected, weakly connected and strongly connected UrbanGraph components.
  • Convert to and from NetworkX through optional compatibility utilities.
  • Snap geometries to graph nodes with nearest_nodes and validate custom graph edits.
  • Store graphs as .urbangraph archives with parquet tables and metadata.
  • Cache Overpass responses and query historical OSM snapshots.

Installation

pip install iduedu

IduEdu supports Python 3.11 through 3.14. The core package uses the standard geospatial stack including GeoPandas, Shapely, PyProj, NumPy, Pandas and SciPy. NetworkX utilities are optional compatibility helpers.

Use pip install "iduedu[io]" to enable .urbangraph parquet archive read/write helpers and pip install "iduedu[elevation]" to read elevation rasters with rasterio.

Wheels include the compiled Rust core; building from source needs a stable Rust toolchain (1.82 or newer).

The same OSM graphs can be built offline from local .osm.pbf extracts (for example Geofabrik downloads) instead of the Overpass API, with no extra dependency; see the data sources guide.

Quickstart

Build an intermodal graph

from iduedu import get_intermodal_graph

graph = get_intermodal_graph(
    osm_id=1114252,  # for example, Saint Petersburg's Vasileostrovsky District
    pt_kwargs={"transport_types": ["bus", "tram", "subway"]},
)

print(graph.nodes_gdf.head())
print(graph.edges_gdf.head())

Graph builders return UrbanGraph. Nodes are stored in graph.nodes_gdf; edges are stored in graph.edges_gdf and include u, v, geometry, length_meter and time_min.

OSM-based boarding waits are mode-specific defaults stored in TransportRegistry. GTFS boarding waits are derived from the selected feed schedule instead.

Build a public-transport graph from GTFS

from iduedu import get_gtfs_public_transport_graph

pt_graph = get_gtfs_public_transport_graph(
    "feed.zip",
    service_date="2026-08-04",
    start_time="07:00:00",
    end_time="10:00:00",
)

The source can be a GTFS directory, a ZIP archive, or a list of feeds to merge. See the GTFS guide for schedule aggregation, geometry fallbacks, single-departure handling and intermodal joining.

Compute an OD matrix

from iduedu import od_matrix

nodes = graph.nodes_gdf.index.to_list()

matrix = od_matrix(
    graph,
    origins_nodes=nodes[:5],
    destination_nodes=nodes[5:15],
    weight="time_min",
    cutoff=30,
)

print(matrix)

Use weight="time_min" for travel time in minutes or weight="length_meter" for distance in meters. Pairs without a path, or outside cutoff, are returned as inf; threshold remains a compatible alias.

To calculate distances and routes together, use output="both". Lazy storage reconstructs individual routes without rerunning Dijkstra:

result = graph.od_matrix(
    origins_nodes=nodes[:5],
    destination_nodes=nodes[5:15],
    cutoff=30,  # inclusive; threshold remains a compatible alias
    output="both",
    path_storage="lazy",
)
distances = result.distances
path = result.get_path(nodes[0], nodes[5])  # node list, or None when unreachable
paths = result.paths  # materialize and cache all requested routes

Use output="paths" for routes alone, mode="pairwise" to match inputs by position, and iter_od_matrix to process origin rows in blocks. The general single_source_dijkstra, multi_source_dijkstra (nearest source), and dijkstra_parallel (independent source rows) helpers also support selecting distances, paths, or both. See the routing guide for shapes, lazy storage, and memory limits.

Reconstruct a route

from iduedu import path_to_edges

paths = graph.single_source_dijkstra(
    nodes[0], target_nodes=[nodes[-1]], weight="time_min", output="paths",
)
path = paths.loc[nodes[-1]]
route = path_to_edges(graph, path or [])

print(route[["type", "length_meter", "time_min"]])

Path results contain node ids in travel order, or None when the destination cannot be reached. path_to_edges turns them into the traversed edges with their geometry, type and travel time, ready to plot. The specialised single_source_dijkstra_path helper remains available and returns [] for an unreachable target.

Work with graph components

from iduedu import largest_component, subgraph_by_nodes

component_nodes = largest_component(graph)
main_graph = subgraph_by_nodes(graph, component_nodes)

Public API

Common entry points are available directly from iduedu:

  • Builders: get_drive_graph, get_walk_graph, get_bike_graph, get_public_transport_graph, get_gtfs_public_transport_graph, get_intermodal_graph, join_pt_walk_graph, get_4326_boundary.
  • GTFS: merge_gtfs_feeds, deduplicate_across_feeds; read_gtfs_feed, validate_gtfs_feed and GTFSFeed live in iduedu.gtfs.
  • Transport modes: TransportSpec, TransportRegistry, DEFAULT_REGISTRY, DEFAULT_REGISTRY_W_TRAIN.
  • Graph model: UrbanGraph, UrbanGraphChanges.
  • Editing and transforms: clip_urban_graph, join_urban_graphs, project_objects2urban_graph, apply_urban_graph_changes, subgraph_by_nodes, relabel_urban_graph, simplify_multiedges, to_directed, to_undirected, consolidate_intersections, unique_segments.
  • Graph utilities: nearest_nodes, nearest_edges, validate_graph, UrbanGraph.nearest_nodes, UrbanGraph.validate.
  • Graph IO: read_urban_graph, write_urban_graph, UrbanGraph.read, UrbanGraph.write.
  • Components: connected_components, weakly_connected_components, strongly_connected_components, largest_component.
  • Shortest paths and matrices: single_source_dijkstra, multi_source_dijkstra, dijkstra_parallel, od_matrix, iter_od_matrix, ShortestPathResult, single_source_dijkstra_path, multi_source_dijkstra_nearest_source, path_to_edges, shortest_path, alternative_paths, k_shortest_paths. Removed in 3.0 (use the general helpers with output=...): single_source_dijkstra_path_length, multi_source_dijkstra_path_length, dijkstra_path_length_parallel, multi_source_dijkstra_path.
  • Network analysis: graph_stats, local_stats, edge_stats, transport_stats, streets_per_node, route_directness, nearest_objects, aggregate_objects, diversity, centrality, edge_betweenness, add_elevation, apply_grade_speed.
  • Local OSM files: use_pbf, download_osm_pbf, split_by_polygons, snapshot_time, PbfSource.
  • Optional NetworkX helpers (install networkx separately): urban_graph2nx_graph, nx_graph2urban_graph, graph2gdf, gdf2graph, read_gml, write_gml, clip_nx_graph, reproject_graph.

Configuration

IduEdu reads its settings from the global config object, and most of them also from environment variables. Use it to point requests at another Overpass instance, pace them, cache responses, query a historical OSM snapshot, choose the OSM tags kept on edges, or set up logging:

from iduedu import config

config.set_overpass_url("https://overpass-api.de/api/interpreter")
config.set_rate_limit(min_interval=2.0, max_retries=5)
config.set_overpass_cache(cache_dir=".iduedu_cache", enabled=True)
config.set_overpass_date(date="2020-01-01")  # query OSM as it stood on this date
config.configure_logging(level="INFO")

See the configuration guide for every setting and its environment variable.

Development

This project uses uv.

uv sync --all-groups

Useful commands:

make test           # fast tests, no network
make test-network   # Overpass/network tests
make test-all       # all tests
make coverage       # terminal coverage for fast tests
make coverage-xml   # CI coverage, includes network tests
make format-check
make lint
make docs

See CONTRIBUTING.md for the full development, testing, Conventional Commits and release workflow.

Releases

Releases are automated from Conventional Commit messages on the official IDUclub/IduEdu main branch using python-semantic-release. Do not bump versions or create tags manually. The single source of truth for the package version is iduedu/_version.py; pyproject.toml reads it dynamically at build time.

Contacts

Acknowledgments

Реализовано при финансовой поддержке Фонда поддержки проектов Национальной технологической инициативы в рамках реализации "дорожной карты" развития высокотехнологичного направления "Искусственный интеллект" на период до 2030 года (Договор № 70-2021-00187)

This research is financially supported by the Foundation for National Technology Initiative's Projects Support as a part of the roadmap implementation for the development of the high-tech field of Artificial Intelligence for the period up to 2030 (agreement 70-2021-00187)


License

IduEdu is distributed under the BSD 3-Clause License. See LICENSE.txt for details.


Citing IduEdu

If you use IduEdu in research, please cite it. Citation metadata is kept in CITATION.cff; on GitHub, Cite this repository in the repository sidebar copies it as APA or BibTeX. Publications describing IduEdu will be listed below.

Publications

Coming soon...

Metadata

Release files for iduedu 3.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 iduedu 3.1.1
File Size Uploaded Provenance Actions
iduedu-3.1.1.tar.gz 245.0 kB With provenance Details for iduedu-3.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for iduedu 3.1.1
File Actions
iduedu-3.1.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for iduedu-3.1.1-cp311-abi3-win_amd64.whl
iduedu-3.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for iduedu-3.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
iduedu-3.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for iduedu-3.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
iduedu-3.1.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for iduedu-3.1.1-cp311-abi3-macosx_11_0_arm64.whl
iduedu-3.1.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for iduedu-3.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 7.3 MB

Release files / iduedu-3.1.1.tar.gz

Download URL iduedu-3.1.1.tar.gz
Size 245.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40e52c182f18ad72dec8c5a621ac5f2eb5e308b54f8e88c0295e795f4e0225c4
BLAKE2b-256 checksum
How to use checksums
9fc7fb014dbad7d4ade7f53aa0a79acc5a10da021ffe2f53f1b244246c8ab8e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / iduedu-3.1.1-cp311-abi3-win_amd64.whl

Download URL iduedu-3.1.1-cp311-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
31aada21c21c4351152bc5f88e4d6d6ada403f3c2840893f3b6379f9eee1a523
BLAKE2b-256 checksum
How to use checksums
f2a5856d0b72f7389da11dde553b532f7fea105689e66715755948857b974d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / iduedu-3.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL iduedu-3.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d82b256bda13e3255f903c7cf2a1826b8fe9e817f1bcc7fc41ca6b0eed5467da
BLAKE2b-256 checksum
How to use checksums
c7848997535bb3705cd2e73842b2178f0e7bd963ffb408ca53c22d0c44308e7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / iduedu-3.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL iduedu-3.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
30cd6053f874e2a93a5475be645b00b2923a2b7de325eeae3f72ad455b61627b
BLAKE2b-256 checksum
How to use checksums
6454fa7c4e725ac83232de98f03f1b7af4b3bd20b4ad604ed3c47375c2859df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / iduedu-3.1.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL iduedu-3.1.1-cp311-abi3-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6030b7f4761886bce3b940554a5c265c3311ca6fa3c74c4f31ced9d92556ef8e
BLAKE2b-256 checksum
How to use checksums
0d9f5381c409148eaf56f25ca949cf4cd5782fefb88e40b0c6c5011a1dd9dd3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / iduedu-3.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL iduedu-3.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
09e378a4581ea3f1bac47b5723c8fa57acb33b882966c1443e9a624d42e1321b
BLAKE2b-256 checksum
How to use checksums
743ae6947b1dce1208cb21232921d71f90e99bb6f19234888f7e7a67b5a5c38a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for iduedu 3.1.1

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for iduedu-3.1.1.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.1.1 This release

6 release files Full provenance

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