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.

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 = client.geocode("MG Road, Bangalore")

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

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

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.2.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

olamaps-0.2.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for olamaps-0.2.3.tar.gz
Algorithm Hash digest
SHA256 56232ed36199e2f7497d255158aa24410e01cb6cf35944e34cf5f81718fb29ce
MD5 22913cf88175abe9ef135e5823936204
BLAKE2b-256 4ce43c357b43319f14ec7b68521c971b4751451b9f8b8d6db4025373f5550c33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: olamaps-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fcf1b1a95e0c4f37ec2af5e3705c7004d25ad927afd469208d56e7d9cd3194a8
MD5 f31583eabb1f134c5b5a7b548cb6aab3
BLAKE2b-256 e025c712907b54cea3683dbe6a02b5fd6849e589094e1bc251805bfcf1b1ef2c

See more details on using hashes here.

Supported by

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