py-osrm-client


Namepy-osrm-client JSON
Version 1.1.0 PyPI version JSON
download
home_page
SummaryPython client for OSRM api
upload_time2023-12-23 15:42:33
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords osrm osrm-api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-osrm-client
![build](https://github.com/tomrss/py-osrm-client/actions/workflows/build.yml/badge.svg)
![publish](https://github.com/tomrss/py-osrm-client/actions/workflows/publish.yml/badge.svg)
[![PyPI version](https://badge.fury.io/py/py-osrm-client.svg)](https://badge.fury.io/py/py-osrm-client)

Simple and typed Python client for [OSRM](https://project-osrm.org/) api.

## Requirements

- [requests](https://pypi.org/project/requests/)
- [aiohttp](https://pypi.org/project/aiohttp/)


## Installation

```shell
pip install py-osrm-client
```

## Usage

Async client:

```python
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:

```python
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](https://router.project-osrm.org). 
To use another OSRM server:

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

Refer to [OSRM api documentation](https://project-osrm.org/docs/v5.24.0/api/) for more details
about OSRM services and options.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "py-osrm-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "osrm,osrm-api,client",
    "author": "",
    "author_email": "Tommaso Rossi <tommaso.rossi1@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2d/b5/b9fed36d01c8142173f2fa008521f9e247254fcc76b28cbfb8451da3aa65/py-osrm-client-1.1.0.tar.gz",
    "platform": null,
    "description": "# py-osrm-client\n![build](https://github.com/tomrss/py-osrm-client/actions/workflows/build.yml/badge.svg)\n![publish](https://github.com/tomrss/py-osrm-client/actions/workflows/publish.yml/badge.svg)\n[![PyPI version](https://badge.fury.io/py/py-osrm-client.svg)](https://badge.fury.io/py/py-osrm-client)\n\nSimple and typed Python client for [OSRM](https://project-osrm.org/) api.\n\n## Requirements\n\n- [requests](https://pypi.org/project/requests/)\n- [aiohttp](https://pypi.org/project/aiohttp/)\n\n\n## Installation\n\n```shell\npip install py-osrm-client\n```\n\n## Usage\n\nAsync client:\n\n```python\nimport asyncio\nfrom osrm import OsrmAsyncClient\n\nasync def example():\n    async with OsrmAsyncClient() as osrm:\n        coordinates = [(0.1, 0.2), (0.3, 0.4)]\n        trip = await osrm.trip(coordinates)\n        print(trip)\n\nasyncio.run(example())\n```\n\n\nSync client:\n\n```python\nfrom osrm import OsrmClient\n\nwith OsrmClient() as osrm:\n    coordinates = [(0.1, 0.2), (0.3, 0.4)]\n    trip = osrm.trip(coordinates)\n    print(trip)\n```\n\nBy default the clients will refer to the OSRM demo server at [https://router.project-osrm.org](https://router.project-osrm.org). \nTo use another OSRM server:\n\n```python\nasync with OsrmAsyncClient(base_url='https://my-custom-osrm-server.com') as osrm:\n    # use client\n```\n\nRefer to [OSRM api documentation](https://project-osrm.org/docs/v5.24.0/api/) for more details\nabout OSRM services and options.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for OSRM api",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/tomrss/py-osrm-client",
        "Issues": "https://github.com/tomrss/py-osrm-client/issues"
    },
    "split_keywords": [
        "osrm",
        "osrm-api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "022203669b0efcb7e9be83bf67973f79a11d0cd04c2f5dd78fe8fb598ca22d4d",
                "md5": "37285419cbcf83432a2bf43c362b2896",
                "sha256": "f85d207c984b0c8fd2750773bcef074fb22b2a5ed882d8074398331cfb217390"
            },
            "downloads": -1,
            "filename": "py_osrm_client-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37285419cbcf83432a2bf43c362b2896",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11959,
            "upload_time": "2023-12-23T15:42:31",
            "upload_time_iso_8601": "2023-12-23T15:42:31.978426Z",
            "url": "https://files.pythonhosted.org/packages/02/22/03669b0efcb7e9be83bf67973f79a11d0cd04c2f5dd78fe8fb598ca22d4d/py_osrm_client-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2db5b9fed36d01c8142173f2fa008521f9e247254fcc76b28cbfb8451da3aa65",
                "md5": "1348fa7a4d1f3840a8215d2bcb469741",
                "sha256": "875207f88f29bfecf52ef90b3ff9ab0c92bc6653fa81ab2a0e230158861fdaa5"
            },
            "downloads": -1,
            "filename": "py-osrm-client-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1348fa7a4d1f3840a8215d2bcb469741",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10675,
            "upload_time": "2023-12-23T15:42:33",
            "upload_time_iso_8601": "2023-12-23T15:42:33.476652Z",
            "url": "https://files.pythonhosted.org/packages/2d/b5/b9fed36d01c8142173f2fa008521f9e247254fcc76b28cbfb8451da3aa65/py-osrm-client-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-23 15:42:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tomrss",
    "github_project": "py-osrm-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py-osrm-client"
}
        
Elapsed time: 0.18397s