Modules Documentation

APIS

class herepy.geocoder_api.GeocoderApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Geocoder API

address_with_boundingbox(searchtext, top_left, bottom_right)[source]

Geocodes given search text with in given boundingbox Args:

searchtext (str):
possible address text.
top_left (array):
array including latitude and longitude in order.
bottom_right (array):
array including latitude and longitude in order.
Returns:
GeocoderResponse or HEREError instance
address_with_details(house_number, street, city, country)[source]

Geocodes with given address details Args:

house_number (int):
house number.
street (str):
street name.
city (str):
city name.
country (str):
country name.
Returns:
GeocoderResponse or HEREError instance
free_form(searchtext)[source]

Geocodes given search text Args:

searchtext (str):
possible address text.
Returns:
GeocoderResponse or HEREError instance
street_intersection(street, city)[source]

Geocodes with given street and city Args:

street (str):
street name.
city (str):
city name.
Returns:
GeocoderResponse or HEREError instance
class herepy.geocoder_autocomplete_api.GeocoderAutoCompleteApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Geocoder Auto Complete API

address_suggestion(query, prox, radius)[source]

Request a list of suggested addresses found within a specified area Args:

prox (array):
array including latitude and longitude in order.
radius (int):
Radius in meters
Returns:
GeocoderAutoCompleteApi or HEREError instance
highlighting_matches(query, begin_highlight, end_highlight)[source]

Request an annotated list of suggested addresses with matching tokens highlighted Args:

query (str):
Query search string
begin_highlight (str):
Mark the beginning of match in a token
end_highlight (str):
Mark the end of match in a token
Returns:
GeocoderAutoCompleteApi or HEREError instance
limit_results_byaddress(query, country_code)[source]

Request a list of suggested addresses within a single country Args:

query (str):
Query search string
countryCode (str):
Country code (USA etc.)
Returns:
GeocoderAutoCompleteApi or HEREError instance
class herepy.geocoder_reverse_api.GeocoderReverseApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Geocoder Reverse API

retrieve_addresses(prox, radius=250, max_results=1, gen=9)[source]

Gets the address information of a point within given radius Args:

prox (lat/lon):
latitude longitude of the point
radius (int):
radius of the area in meters
max_results (int):
maximum resuls to retrieve.
Returns:
GeocoderReverseResponse or HEREError instance
class herepy.places_api.PlacesApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Places (Search) API

category_places_at(coordinates, categories=None)[source]

Request a list of places within a category around a location Args:

coordinates (array):
array including latitude and longitude in order.
categories (array):
array including PlacesCategory enums.
Returns:
PlacesResponse instance or HEREError
nearby_places(coordinates)[source]

Request a list of places close to a location Args:

coordinates (array):
array including latitude and longitude in order.
Returns:
PlacesResponse instance or HEREError

Request a list of nearby places based on a query string Args:

coordinates (array):
array including latitude and longitude in order.
query (str):
search term.
Returns:
PlacesResponse instance or HEREError
place_categories(coordinates)[source]

Request a list of place categories available for a given location Args:

coordinates (array):
array including latitude and longitude in order.
Returns:
PlaceCategoriesResponse instance or HEREError
places_at(coordinates)[source]

Request a list of popular places around a location Args:

coordinates (array):
array including latitude and longitude in order.
Returns:
PlacesResponse instance or HEREError
places_at_boundingbox(coordinates_a, coordinates_b)[source]

Request a list of popular places within a specified area Args:

coordinates_a (array):
array including latitude and longitude in order.
coordinates_b (array):
array including latitude and longitude in order.
Returns:
PlacesResponse instance or HEREError
places_with_language(coordinates, language)[source]

Request a list of popular places around a location using a foreign language Args:

coordinates (array):
array including latitude and longitude in order.
language (str):
string value for language like en-US
Returns:
PlacesResponse instance or HEREError
search_suggestions(coordinates, query)[source]

Request a list of suggestions based on a partial query string Args:

coordinates (array):
array including latitude and longitude in order.
query (str):
search term.
Returns:
PlacesSuggestionsResponse instance or HEREError
class herepy.public_transit_api.PublicTransitApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Public Transit API

calculate_route(departure, arrival, time, routing_type=<PublicTransitRoutingType.time_tabled: 'tt'>)[source]

Request a public transit route between any two place. Args:

departure (array):
array including latitude and longitude in order.
arrival (array):
array including latitude and longitude in order.
time (str):
time formatted in yyyy-mm-ddThh:mm:ss.
routing_type (PublicTransitRoutingType):
type of routing. Default is time_tabled.
calculate_route_time(departure, arrival, time, show_arrival_times, routing_type=<PublicTransitRoutingType.time_tabled: 'tt'>)[source]

Request a public transit route between any two place. Args:

departure (array):
array including latitude and longitude in order.
arrival (array):
array including latitude and longitude in order.
time (str):
time formatted in yyyy-mm-ddThh:mm:ss.
show_arrival_times (boolean):
flag to indicate if response should show arrival times.
routing_type (PublicTransitRoutingType):
type of routing. Default is time_tabled
coverage_nearby(details, center)[source]

Request a list of transit operators and station coverage nearby. Args:

details (int):
0 disables showing line info, 1 enables showing line info.abs
center (array):
array including latitude and longitude in order.
coverage_witin_a_city(city_name, political_view, max=None, details=1, lang='en')[source]

Request a list of transit operator coverage within a specified city. Args:

city_name (str):
the name or part of the name of the search city.
max (int):
maximum number of results.
political_view (int):
1 enables, 0 disables grouping results.
details (int):
with 1 supported list of operators and population added to response. Set to 0 just return the matching city names.
lang (str):
the language of the response, default en.
find_stations_by_id(ids, lang)[source]

Request details of a specific transit station based on a previous request. Args:

ids (array):
array contains station ids.
lang (str):
language code for response like en.
find_stations_by_name(center, name, max_count=5, method=<PublicTransitSearchMethod.fuzzy: 'fuzzy'>, radius=20000)[source]

Request a list of public transit stations based on name. Args:

center (array):
array including latitude and longitude in order.
name (str):
station name.
max_count (int):
maximum number of stations (Default is 5).
method (enum):
Matching method from PublicTransitSearchMethod (Default is fuzzy).
radius (int):
specifies radius in kilometers (Default is 20000km).
find_stations_nearby(center, radius=500, max_count=5)[source]

Request a list of public transit stations within a given geo-location. Args:

center (array):
array including latitude and longitude in order.
radius (int):
specifies radius in meters (Default is 500m).
max_count (int):
maximum number of stations (Default is 5).
find_transit_coverage_in_cities(center, political_view, radius)[source]

Request a list of transit operators available in cities nearby. Args:

center (array):
array including latitude and longitude in order.
political_view (str):
switch for grouping results like CHN.
radius (int):
specifies radius in meters.
next_departures_for_stations(station_ids, time, lang='en', max=40, max_station=40)[source]

Request a list of all next departure times and destinations for a give list of stations. Args:

station_ids (array):
a list of stop ids.
time (str):
time formattes in yyyy-mm-ddThh:mm:ss.
lang (str):
language code for response like en. Default is en.
max (int):
maximum number of next departures per station. Default is 40.
max_station (int):
maximum number of stations for which departures are required. Default is 40.
next_departures_from_location(center, time, lang='en', max=40, max_station=40)[source]

Request a list of all next departure times and destinations from a given location. Args:

center (array):
array including latitude and longitude in order.
time (str):
time formattes in yyyy-mm-ddThh:mm:ss.
lang (str):
language code for response like en. Default is en.
max (int):
maximum number of next departures per station. Default is 40.
max_station (int):
maximum number of stations for which departures are required. Default is 40.
next_nearby_departures_of_station(station_id, time, lang='en')[source]

Request a list of next departure times and destinations of a particular station. Args:

lang (str):
language code for response like en Default is en.
station_id (int):
station id for departures.
time (str):
time formattes in yyyy-mm-ddThh:mm:ss.
route_excluding_changes_transfers(departure, arrival, time, routing_type=<PublicTransitRoutingType.time_tabled: 'tt'>, changes=-1)[source]

Request a direct public transit route excluding changes and transfers. Args:

departure (array):
array including latitude and longitude in order.
arrival (array):
array including latitude and longitude in order.
time (str):
time formatted in yyyy-mm-ddThh:mm:ss.
routing_type (PublicTransitRoutingType):
type of routing. Default is time_tabled.
changes (int):
Maximum number of changes or transfers. Default is -1 and max is 6.
transit_route_shows_line_graph(departure, arrival, time, routing_type=<PublicTransitRoutingType.time_tabled: 'tt'>, graph=0)[source]

Request a public transit route between any two place. Args:

departure (array):
array including latitude and longitude in order.
arrival (array):
array including latitude and longitude in order.
time (str):
time formatted in yyyy-mm-ddThh:mm:ss.
routing_type (PublicTransitRoutingType):
type of routing. Default is time_tabled.
graph (int):
Enable showing line graph. Default is 0 disabled, to enable set 1.
class herepy.routing_api.RoutingApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Routing API

car_route(waypoint_a, waypoint_b, modes=None)[source]

Request a driving route between two points Args:

waypoint_a (array):
array including latitude and longitude in order.
waypoint_b (array):
array including latitude and longitude in order.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
intermediate_route(waypoint_a, waypoint_b, waypoint_c, modes=None)[source]

Request a intermediate route from three points Args:

waypoint_a (array):
Starting array including latitude and longitude in order.
waypoint_b (array):
Intermediate array including latitude and longitude in order.
waypoint_c (array):
Last array including latitude and longitude in order.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
location_near_motorway(waypoint_a, waypoint_b, modes=None)[source]

Calculates the fastest car route between two location Args:

waypoint_a (array):
array including latitude and longitude in order.
waypoint_b (array):
array including latitude and longitude in order.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
pedastrian_route(waypoint_a, waypoint_b, modes=None)[source]

Request a pedastrian route between two points Args:

waypoint_a (array):
array including latitude and longitude in order.
waypoint_b (array):
array including latitude and longitude in order.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
public_transport(waypoint_a, waypoint_b, combine_change, modes=None)[source]

Request a public transport route between two points Args:

waypoint_a (array):
Starting array including latitude and longitude in order.
waypoint_b (array):
Intermediate array including latitude and longitude in order.
combine_change (bool):
Enables the change manuever in the route response, which indicates a public transit line change.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
truck_route(waypoint_a, waypoint_b, modes=None)[source]

Calculates the fastest truck route between two location Args:

waypoint_a (array):
array including latitude and longitude in order.
waypoint_b (array):
array including latitude and longitude in order.
modes (array):
array including RouteMode enums.
Returns:
RoutingResponse instance or HEREError
class herepy.destination_weather_api.DestinationWeatherApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the HERE Destination Weather API

forecast_astronomy(destination, product=<WeatherProductType.observation: 'observation'>)[source]

Request forecast for given destination. Args:

destination (str):
Destination name.
product (str):
A parameter identifying the type of report to obtain. Default value observation.
Returns:
DestinationWeatherResponse instance or HEREError
class herepy.rme_api.RmeApi(app_id=None, app_code=None, timeout=None)[source]

Bases: herepy.here_api.HEREApi

A python interface into the RME API

match_route(gpx_file_content, route_mode='car', pde_layers=[])[source]

Retrieves misc information about the route given in gpx file Args:

gpxfile content (str):
gpx file content as string
routemode (str):
route mode (‘car’)
pde_layers (str list):
PDE layers to retrieve e.g.:

ROAD_GEOM_FCn(TUNNEL) SPEED_LIMITS_FCn(FROM_REF_SPEED_LIMIT,TO_REF_SPEED_LIMIT) ADAS_ATTRIB_FCn(SLOPES)

or e.g.,

ROAD_GEOM_FCn(*) SPEED_LIMITS_FCn(*)

Returns:
RmeResponse or HEREError instance
exception herepy.error.HEREError[source]

Bases: exceptions.Exception

Base class for HERE errors

message

Returns the first argument used to construct this error.

Models

class herepy.models.DestinationWeatherResponse(param_defaults, **kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Weather Forecasts for DestinationWeather Api.

classmethod new_from_jsondict(data, param_defaults, **kwargs)[source]

Create a new instance based on a JSON dict. Any kwargs should be supplied by the inherited, calling class.

Args:
data (dict):
A JSON dict, as converted from the JSON in the here API.
class herepy.models.GeocoderAutoCompleteResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Geocoder Autocomplete Api response data.

class herepy.models.GeocoderResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Geocoder Api response data.

class herepy.models.GeocoderReverseResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Geocoder Reverse Api response data.

class herepy.models.HEREModel(**kwargs)[source]

Bases: object

Base class from which all here models will inherit.

as_dict()[source]

Create a dictionary representation of the object. Please see inline comments on construction when dictionaries contain HEREModels.

as_json_string()[source]

Returns the HEREModel as a JSON string based on key/value pairs returned from the as_dict() method.

classmethod new_from_jsondict(data, **kwargs)[source]

Create a new instance based on a JSON dict. Any kwargs should be supplied by the inherited, calling class.

Args:
data (dict):
A JSON dict, as converted from the JSON in the here API.
class herepy.models.PlaceCategoriesResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Places (Search) Api categories response data.

class herepy.models.PlacesResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Places (Search) Api response data.

class herepy.models.PlacesSuggestionsResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Places (Search) Api suggestions response data.

class herepy.models.PublicTransitResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Public Transit Api response data.

class herepy.models.RmeResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the RME (Route Matcher) Api response data.

class herepy.models.RoutingResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Routing Api response data.

class herepy.models.TrafficIncidentResponse(**kwargs)[source]

Bases: herepy.models.HEREModel

A class representing the Traffic Incidents on Traffic Api response data.

Utilities

class herepy.utils.Utils[source]

Bases: object

Helper class for main api classes

static build_url(url, extra_params=None)[source]

Builds a url with given parameters which will be used in requests. Args:

url (str):
base url.
extra_params (dict):
dictionary of query parameters.
Returns:
A encoded url ready for the request
static encode_parameters(parameters)[source]

Return a string in key=value&key=value form. Values of None are not included in the output string. Args:

parameters (dict):
dictionary of query parameters to be converted.
Returns:
A URL-encoded string in “key=value&key=value” form
static get_zipped_base64(content)[source]