Download the walkable or drivable street network for any city and find the shortest path between two locations
Analyze how connected a neighborhood's road layout is and compare it to other cities
Visualize the compass orientation of streets in a city as a polar histogram chart
Map all parks, shops, or transit stops from OpenStreetMap within a given geographic area
Published research work that uses OSMnx data must include OpenStreetMap attribution as required by the ODbL license.
OSMnx is a Python package for downloading, modeling, analyzing, and visualizing street networks and other geographic features from OpenStreetMap. OpenStreetMap is a free, community-built map of the world, and OSMnx gives Python users a way to pull data from it and work with it programmatically without needing to handle the raw data format yourself. The core use case is street networks. With a single line of Python code you can download the road network for a city or neighborhood, configured for walking, driving, or cycling. The result is a network graph, which is a data structure that represents intersections as nodes and streets as edges between them. You can then run analysis on that graph, such as calculating distances, finding shortest paths, or measuring the connectivity of the road layout. Beyond road networks, OSMnx also handles other types of geographic data that OpenStreetMap contains: points of interest like shops and parks, building footprints, transit stops, and elevation information. It includes tools for calculating travel times and speeds on routes, and for visualizing street orientations as a compass-rose chart. The package is built for researchers, urban planners, and data scientists who study cities and transportation. It has an associated academic paper published in Geographical Analysis in 2025 and is frequently used in academic work, which means it expects users to cite that paper when using it in research. Installation is covered in its documentation, and a separate examples gallery provides step-by-step tutorials. The package is open source under the MIT license, though users who publish work using OpenStreetMap data need to include proper attribution to OpenStreetMap, as required by its open data license.
← gboeing on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.