Skip to main content

Python client library for Ola Maps API Web Services

Project description

OLA Maps Python Package (unofficial)

A Python wrapper for the OLA Maps API, providing easy-to-use abstractions for developers.

Stable Version Python Versions Download Stats

Installation

Install the package using pip:

pip install olamaps

Supported APIs

  • Geocoding
  • Reverse geocoding
  • Directions

Authentication

There are two ways to authenticate:

  1. Using API key

    os.environ["OLAMAPS_API_KEY"] = "your_api_key"
    
    # OR
    client = Client(api_key="your_api_key_here")
    
  2. Or using client_id and client_secret

    os.environ["OLAMAPS_CLIENT_ID"] = "your_client_id"
    os.environ["OLAMAPS_CLIENT_SECRET"] = "your_client_secret"
    
    # OR
    client = Client(client_id="your_client_id", client_secret="your_client_secret")
    

Usage

import os
from olamaps import Client

# Initialize the client
client = Client()

# Geocode an address
results = await client.geocode("MG Road, Bangalore")

# Reverse geocode a latitude-longitude pair
results = await client.reverse_geocode(lat=12.9519408, lng=77.6381845)

# Get directions from one place to another
results = await client.directions(
    origin="12.993103152916301,77.54332622119354",
    destination="12.972006793201695,77.5800850011884",
)

# close the client
await client.close()

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This project is not officially associated with or endorsed by OLA. Use of the OLA Maps API is subject to OLA's terms of service.

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

olamaps-0.3.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

olamaps-0.3.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file olamaps-0.3.0.tar.gz.

File metadata

  • Download URL: olamaps-0.3.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for olamaps-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aae8e2f90ba17f66e6a59306344a801cee148ee2c91ac8ca098cea1816712876
MD5 a1a2a95db1fa26cf797475a374feb122
BLAKE2b-256 4cc3cfe883995cafb3bda034ae77914c41ee7651cab96ec234a4e5ae1f61c9c6

See more details on using hashes here.

File details

Details for the file olamaps-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: olamaps-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for olamaps-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fe23c28e775d1253cb8ea6dc0d0b7ef321f0342f3c00609fb906abbef08f388
MD5 e2355a4e6542b24cb73eaccabefa96f9
BLAKE2b-256 6ed2fa33b1fc31f82588528e065742723c14ac4b3f43d94a5e24aec1134c8d37

See more details on using hashes here.

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