Skip to main content

HERE Location Services for Python

Project description

HERE Location Services for Python

Tests Documentation Status codecov PyPI - Status PyPI - Python Version PyPI - Python Version PyPI - License Downloads Conda (channel only) Conda Downloads Anaconda-Server Badge Binder

A Python client for HERE Location Services.

Usage

Geocoding using HERE Geocoding & Search API.

Geocoding Example

Prerequisites

Before you can install HERE Location Services for Python, run its test-suite, or use the example notebooks to make sure you meet the following prerequisites:

  • A Python installation, 3.6+ recommended, with the pip command available to install dependencies.
  • A HERE developer account, freely available under HERE Developer Portal.
  • An API key from the HERE Developer Portal, in an environment variable named LS_API_KEY which you can set like this (with a valid value, of course):
    $ export LS_API_KEY="MY-LS-API-KEY"
    

Installation

  • Install HERE Location Services for Python with conda from the Anaconda conda-forge channel using the below command:

    $ conda install -c conda-forge here-location-services
    
  • Install HERE Location Services for Python from PyPI using the below command:

    $ pip install here-location-services
    
  • Install HERE Location Services for Python from GitHub using the below command:

    $ pip install -e git+https://github.com/heremaps/here-location-services-python#egg=here-location-services
    

Run Test Suite

Run the test suite using below commands:

$ pip install -r requirements_dev.txt
$ pytest -v --cov=here_location_services tests

Documentation

Documentation is available here.

Run the below commands to build the docs locally:

$ pip install -e .
$ pip install -r requirements_dev.txt
$ sh scripts/build_docs.sh

Hello World Example

This is a tiny "Hello World" like example that you can run to geocode the given address right away. Just make sure to use your own real API key.

import json
import os

from here_location_services import LS


LS_API_KEY = os.environ.get("LS_API_KEY")  # Get API KEY from environment.
ls = LS(api_key=LS_API_KEY)

address = "Invalidenstr 116, 10115 Berlin, Germany"
geo = ls.geocode(query=address)
print(json.dumps(geo.to_geojson(), indent=2, sort_keys=True))

License

Copyright (C) 2019-2021 HERE Europe B.V.

See the License file in the root of this project for license details.

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

here-location-services-0.2.0.tar.gz (37.1 kB view details)

Uploaded Source

Built Distribution

here_location_services-0.2.0-py2.py3-none-any.whl (39.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file here-location-services-0.2.0.tar.gz.

File metadata

  • Download URL: here-location-services-0.2.0.tar.gz
  • Upload date:
  • Size: 37.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for here-location-services-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4bd57a8a1a4f733c8179d1905a3feab974bca021153b1dacfba876b30a41fabb
MD5 a4fd973475f2b7e690cd72a80d6cf19e
BLAKE2b-256 5c895a853f530cd3f648e85cc37811e6acca63b058bff4bf5d0d32aaeeb5be00

See more details on using hashes here.

File details

Details for the file here_location_services-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: here_location_services-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for here_location_services-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0e41726c066eabc5c02d1853d62b0292922e4280aa508125f6b1fd8491ef3b12
MD5 852bd27cd79d8de447142568f34c9a19
BLAKE2b-256 6adf66ab7be4c19dd11d3388aa53972a110e58a1ded050507cb64199d56899e0

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