Shp2graph is a project mainly written in Python, it's free.
Convert an ESRI shapefile to a network graph represenation, suitable for shortest path and other standard graph theoretic computations