Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18 Commits

Repository files navigation

osrm-py

A Python client for OSRM API

Running the test suite

pythonsetup.pytest

Requires

  • requests
  • aiohttp

Usage

With using requests

importosrmclient=osrm.Client(host='http://localhost:5000')
response=client.route(
coordinates=[[-74.0056, 40.6197], [-74.0034, 40.6333]],
overview=osrm.overview.full)
print(response)

With using aiohttp

importasyncioimportosrmloop=asyncio.get_event_loop()
asyncdefrequest():
client=osrm.AioHTTPClient(host='http://localhost:5000')
response=awaitclient.route(
coordinates=[[-74.0056, 40.6197], [-74.0034, 40.6333]],
overview=osrm.overview.full)
print(response)
awaitclient.close()
loop.run_until_complete(request())

About

Python client for OSRM API

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages