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

Uploaded Source

Built Distribution

here_location_services-0.3.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.3.0.tar.gz.

File metadata

  • Download URL: here-location-services-0.3.0.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for here-location-services-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9be1ca7f4e7151774c889343f6cdbfb32301460fc992d141f33320e167a42e3b
MD5 d41c37578e43cf8455343e7d3a81556b
BLAKE2b-256 8f2105f408c8f5229aa9e833487bbebd88b69e0a35fd57c3e7969268fbbc7e2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: here_location_services-0.3.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.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for here_location_services-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58f59bf01b229d7ae84fc1263c885bb2ac7c5ea166c7edb20b7363f8f3db800c
MD5 3c17ed02845d0a9a844c8ba190358439
BLAKE2b-256 84011ea00596c97b7fd6ebadebf406aa08b3bef73c861950adf69c824c281397

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