Skip to main content

Python client for OSRM api

Project description

py-osrm-client

build publish PyPI version

Simple and typed Python client for OSRM api.

Requirements

Installation

pip install py-osrm-client

Usage

Async client:

import asyncio
from osrm import OsrmAsyncClient

async def example():
    async with OsrmAsyncClient() as osrm:
        coordinates = [(0.1, 0.2), (0.3, 0.4)]
        trip = await osrm.trip(coordinates)
        print(trip)

asyncio.run(example())

Sync client:

from osrm import OsrmClient

with OsrmClient() as osrm:
    coordinates = [(0.1, 0.2), (0.3, 0.4)]
    trip = osrm.trip(coordinates)
    print(trip)

By default the clients will refer to the OSRM demo server at https://router.project-osrm.org. To use another OSRM server:

async with OsrmAsyncClient(base_url='https://my-custom-osrm-server.com') as osrm:
    # use client

Refer to OSRM api documentation for more details about OSRM services and options.

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

py_osrm_client-1.2.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_osrm_client-1.2.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file py_osrm_client-1.2.1.tar.gz.

File metadata

  • Download URL: py_osrm_client-1.2.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for py_osrm_client-1.2.1.tar.gz
Algorithm Hash digest
SHA256 d704f511110520f2c0acc69fd6b4931f47ba6d888ae57402733a0dff4394b779
MD5 4a9951b26ae9dce107c6a2ef89779f57
BLAKE2b-256 24aff5a16dfe59cff290fbec76d9183002cf632869cf86cc7ddfa86b5899c84c

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_osrm_client-1.2.1.tar.gz:

Publisher: publish.yml on tomrss/py-osrm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_osrm_client-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: py_osrm_client-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for py_osrm_client-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b01265b1df19e0781a557331c37050d8a3b66904c4672bf2887d4b856429e84f
MD5 bf15e597a790f23d4928c94c03f7ca36
BLAKE2b-256 7c829627fea54190574625333d81223a52611c11e47b427aacc10482ea9075d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_osrm_client-1.2.1-py3-none-any.whl:

Publisher: publish.yml on tomrss/py-osrm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page