Pyroutelib2
From OpenStreetMap Wiki
A command-line/library version of pyroute, which uses a Tile data server and pyrender-style cache directory to load tiles of map data on-demand as the possible routes venture into new areas
Installing
http://svn.openstreetmap.org/applications/routing/pyroutelib2/
Usage
See the test suite at the end of route.py for sample usage in python
To create a GPX route, run:
$ python routeAsGpx.py Usage: routeAsGpx.py lat1 lon1 lat2 lon2 transport
Transport can be found in weights.py (car, cat, foot, horse, cycle)