Python client for OSRM API
Project description
A Python client for OSRM API
Running the test suite
python setup.py test
Requires
requests
aiohttp
Usage
With using requests
import osrm
client = 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
import asyncio
import osrm
loop = asyncio.get_event_loop()
async def request():
client = osrm.AioHTTPClient(host='http://localhost:5000')
response = await client.route(
coordinates=[[-74.0056, 40.6197], [-74.0034, 40.6333]],
overview=osrm.overview.full)
print(response)
await client.close()
loop.run_until_complete(request())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
osrm-py-0.5.tar.gz
(6.5 kB
view details)
File details
Details for the file osrm-py-0.5.tar.gz
.
File metadata
- Download URL: osrm-py-0.5.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae0fe4c943849e1b8ef0f99e768ffcd18787b4f2dced9fd0642998fad3f5ac6 |
|
MD5 | e1d4bf54ac551d4673b596736fe4f219 |
|
BLAKE2b-256 | 7c402d6d0245df9b528f22fb9bcabc6ae656dbde8e33036f1b9328852c746880 |