Show HN: US Routing – Python library for fast local routing in the US
Published on: 2025-07-24 11:51:32
US Routing
US Routing is a Python library for fast local routing in the United States. It's useful when approximations are acceptable. It bootstraps from the North American Roads dataset.
Installation
You can install US Routing using pip:
pip install us-routing
or using poetry:
git clone https://github.com/ivanbelenky/us-routing.git cd us-routing poetry install
Usage
Here's a quick example of how to use US Routing:
from us_routing import get_route # Route between two cities r = get_route ( 'New York' , 'Los Angeles' , edge_distance = "DURATION" ) print ( r . total_distance , r . duration ) # Output in km of course: # 4434.759999999997 1 day, 20:46:24.499959 # Print route steps print ( r ) # Output: [ #POINT (-73.99811899964011 40.7508730002449) -> POINT (-74.0013209995546 40.74648499998924) (0.5700000000000001 km) 9TH AV, SP_TH_MA, 72 km/h #POINT (-74.0013209995546 40.74648499998924) -> POINT (-74.0054249996425 40.74097199980971) (0.6799999999999999 km) 9TH AV, SP_TH_MA, 72 km
... Read full article.