herepy 3.6.6__tar.gz → 3.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {herepy-3.6.6 → herepy-3.7.1}/.github/workflows/ci.yml +1 -1
- herepy-3.7.1/.github/workflows/deploy-docs.yml +41 -0
- {herepy-3.6.6 → herepy-3.7.1}/PKG-INFO +24 -12
- {herepy-3.6.6 → herepy-3.7.1}/README.rst +20 -10
- {herepy-3.6.6 → herepy-3.7.1}/docs/index.md +1 -1
- {herepy-3.6.6 → herepy-3.7.1}/mkdocs.yml +1 -1
- {herepy-3.6.6 → herepy-3.7.1}/pyproject.toml +7 -6
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/__init__.py +2 -2
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/destination_weather_api.py +119 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/ev_charging_stations_api.py +214 -6
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/fleet_telematics_api.py +125 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/geocoder_api.py +157 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/geocoder_autocomplete_api.py +72 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/geocoder_reverse_api.py +46 -0
- herepy-3.7.1/src/herepy/here_api.py +60 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/isoline_routing_api.py +314 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/map_image_api.py +146 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/map_tile_api.py +87 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/places_api.py +119 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/public_transit_api.py +390 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/rme_api.py +51 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/routing_api.py +728 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/traffic_api.py +340 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/vector_tile_api.py +66 -0
- herepy-3.7.1/tests/async_test_helpers.py +45 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_destination_weather_api.py +29 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_ev_charging_stations_api.py +31 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_fleet_telematics_api.py +53 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_geocoder_api.py +39 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_geocoder_autocomplete_api.py +27 -0
- herepy-3.7.1/tests/test_geocoder_reverse_api.py +98 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_isoline_routing_api.py +106 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_map_image_api.py +59 -1
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_map_tile_api.py +43 -1
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_places_api.py +22 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_publictransit_api.py +75 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_rme_api.py +24 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_routing_api.py +198 -1
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_traffic_api.py +60 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_vector_tile_api.py +46 -1
- {herepy-3.6.6 → herepy-3.7.1}/uv.lock +123 -144
- herepy-3.6.6/.github/workflows/deploy-docs.yml +0 -34
- herepy-3.6.6/src/herepy/here_api.py +0 -34
- herepy-3.6.6/tests/test_geocoder_reverse_api.py +0 -45
- herepy-3.6.6/tox.ini +0 -24
- {herepy-3.6.6 → herepy-3.7.1}/.codecov.yml +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/.coveragerc +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/.github/workflows/release.yml +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/.gitignore +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/.vscode/launch.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/.vscode/settings.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/COPYING +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/LICENSE +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/MANIFEST.in +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/NOTICE +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/destination_weather_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/ev_charging_stations_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/fleet_telematics_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/geocoder_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/geocoder_autocomplete_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/geocoder_reverse_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/here_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/isoline_routing_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/map_image_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/map_tile_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/places_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/public_transit_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/rme_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/routing_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/traffic_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/api/vector_tile_api.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/css/custom.css +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/css/termynal.css +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/enums/enums.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/installation.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/js/custom.js +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/js/termynal.js +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/models/models.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/objects/objects.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/docs/utils/utils.md +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/destination_weather_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/ev_charging_stations_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/fleet_telematics_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/geocoder_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/geocoder_autocomplete_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/geocoder_reverse_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/isoline_routing_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/map_image_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/map_tile_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/places_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/public_transit_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/rme_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/routing_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/traffic_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/examples/vector_tile_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/noxfile.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/error.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/here_enum.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/mercator_projection.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/models.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/objects.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/platform/__init__.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/platform/tour_planning_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/polling.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/py.typed +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/src/herepy/utils.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/images/new-delhi-uncertainty.jpg +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weater_zip_code.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_alerts.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_error_invalid_request.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_error_unauthorized.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_forecasts.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_forecasts_astronomy.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_forecasts_hourly.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_forecasts_nsw_alerts.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_forecasts_simple.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/destination_weather_observations.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/ev_charging_station_details.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/ev_charging_stations_circular.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/ev_charging_stations_error_unauthorized.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/fleet_telematics_find_pickups.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/fleet_telematics_find_sequence.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/fleet_telematics_unauthorized_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/geocoder.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/geocoder_autocomplete.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/geocoder_autocomplete_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/geocoder_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/geocoder_reverse.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_based_on_consumption.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_api_multi_range_arrival.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_api_multi_range_departure.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_api_specific_time_arrival.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_api_specific_time_departure.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_distance_response.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_pi_reverse_direction_arrival.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/isoline_routing_pi_reverse_direction_departure.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/matrix.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/not_authorize_access.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/places_api.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/places_api_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_by_id.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_calculate_route_many_transfers.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_calculate_route_time.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_coverage_cities.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_nearby.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_nearby_coverage.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_next_departures_for_stations.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_next_departures_location.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_next_nearby_departures.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_route_shows_line_graph.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_api_router_exclude_changes.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_calculate_route.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/public_transit_city_coverage.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/rme_match_route_api.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_async_matrix_calculation.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_async_matrix_completed.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_bicycle.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_car_route_short.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_error_forbidden_credentials.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_error_invalid_credentials.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_error_invalid_input_data.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_error_no_route_found.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_error_no_route_found_truck.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_matrix.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_matrix_bad_request.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_matrix_multiple_destinations.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_matrix_multiple_starts.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_pedestrian.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_public.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_public_time_table.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_truck_route_short.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_v8_error_access_denied.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_v8_error_malformed_req.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/routing_v8_response.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_additional_attributes.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow_availability.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow_corridor.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow_minjamfactor.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow_proximity.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_flow_proximity_attributes.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_api_incidents.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_incidents_bounding_box.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_incidents_corridor.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/traffic_incidents_proximity.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/models/unauthorized_error.json +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/routes/sample.gpx +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/tiles/berlin.png +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/testdata/tiles/omv +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/platform/test_tour_planning_api.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_enum.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_mercator_projection.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_models.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_polling.py +0 -0
- {herepy-3.6.6 → herepy-3.7.1}/tests/test_utils.py +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Build and Deploy to GitHub Pages
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-22.04
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- name: Install uv
|
|
14
|
+
uses: astral-sh/setup-uv@v3
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v4
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.9"
|
|
19
|
+
- name: Install Dependencies
|
|
20
|
+
run: uv sync --group docs
|
|
21
|
+
- name: Build Docs
|
|
22
|
+
run: uv run mkdocs build
|
|
23
|
+
- name: Upload Pages artifact
|
|
24
|
+
uses: actions/upload-pages-artifact@v3
|
|
25
|
+
with:
|
|
26
|
+
path: ./site
|
|
27
|
+
|
|
28
|
+
deploy:
|
|
29
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
30
|
+
needs: build
|
|
31
|
+
runs-on: ubuntu-22.04
|
|
32
|
+
permissions:
|
|
33
|
+
pages: write
|
|
34
|
+
id-token: write
|
|
35
|
+
environment:
|
|
36
|
+
name: github-pages
|
|
37
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
38
|
+
steps:
|
|
39
|
+
- name: Deploy to GitHub Pages
|
|
40
|
+
id: deployment
|
|
41
|
+
uses: actions/deploy-pages@v4
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: herepy
|
|
3
|
-
Version: 3.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 3.7.1
|
|
4
|
+
Summary: A Python interface to HERE location APIs with support for synchronous and asynchronous HTTP calls.
|
|
5
5
|
Project-URL: Repository, https://github.com/abdullahselek/HerePy
|
|
6
6
|
Project-URL: Download, https://pypi.org/pypi/herepy
|
|
7
7
|
Project-URL: Documentation, https://herepy.abdullahselek.com/
|
|
@@ -21,8 +21,10 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
24
25
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
26
|
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: httpx2>=2.14.0
|
|
26
28
|
Requires-Dist: requests<3,>=2.25.1
|
|
27
29
|
Description-Content-Type: text/x-rst
|
|
28
30
|
|
|
@@ -56,7 +58,7 @@ HerePy
|
|
|
56
58
|
Introduction
|
|
57
59
|
============
|
|
58
60
|
|
|
59
|
-
This library provides a pure Python interface for the `HERE API <https://developer.here.com/>`_. It works with Python versions 3.10 and over.
|
|
61
|
+
This library provides a pure Python interface for the `HERE API <https://developer.here.com/>`_. It supports both synchronous and asynchronous HTTP calls, and works with Python versions 3.10 and over.
|
|
60
62
|
|
|
61
63
|
`HERE <https://www.here.com/>`_ provides location based services. HERE exposes a `rest APIs <https://developer.here.com/documentation>`_ and this library is intended to make it even easier for Python programmers to use.
|
|
62
64
|
|
|
@@ -108,9 +110,17 @@ to also run code coverage::
|
|
|
108
110
|
|
|
109
111
|
$ uv run pytest --cov=herepy
|
|
110
112
|
|
|
111
|
-
To run
|
|
113
|
+
To run all checks (format, lint, type check and tests) with nox::
|
|
112
114
|
|
|
113
|
-
$
|
|
115
|
+
$ uv run nox
|
|
116
|
+
|
|
117
|
+
To run only one check, pick a session by name::
|
|
118
|
+
|
|
119
|
+
$ uv run nox -s run_tests
|
|
120
|
+
|
|
121
|
+
To see all available sessions::
|
|
122
|
+
|
|
123
|
+
$ uv run nox --list
|
|
114
124
|
|
|
115
125
|
Models
|
|
116
126
|
======
|
|
@@ -158,21 +168,23 @@ Available API clients in **herepy**::
|
|
|
158
168
|
Documentation
|
|
159
169
|
=============
|
|
160
170
|
|
|
161
|
-
View the latest herepy documentation at `https://
|
|
171
|
+
View the latest herepy documentation at `https://abdullahselek.github.io/HerePy/ <https://abdullahselek.github.io/HerePy/>`_. You can view HERE's API documentation at: `https://developer.here.com/documentation <https://developer.here.com/documentation>`_.
|
|
162
172
|
|
|
163
173
|
Using
|
|
164
174
|
=====
|
|
165
175
|
|
|
166
176
|
The library provides a Python wrapper around the HERE APIs with different data models. To get started, check out the examples in the ``examples/`` folder or
|
|
167
|
-
read the documentation at `https://
|
|
177
|
+
read the documentation at `https://abdullahselek.github.io/HerePy/ <https://abdullahselek.github.io/HerePy/>`_. All API clients need an API key which you can get from `HERE Developer Portal <https://developer.here.com/>`_.
|
|
168
178
|
|
|
169
|
-
|
|
170
|
-
|
|
179
|
+
Async API calls
|
|
180
|
+
---------------
|
|
181
|
+
|
|
182
|
+
All API clients provide asynchronous counterparts for their HTTP methods. Use the ``async_`` prefix and manage the client with ``async with``::
|
|
171
183
|
|
|
172
|
-
|
|
184
|
+
async with herepy.GeocoderApi(api_key="YOUR_API_KEY") as geocoder:
|
|
185
|
+
response = await geocoder.async_free_form("Berlin")
|
|
173
186
|
|
|
174
|
-
|
|
175
|
-
$ uv publish
|
|
187
|
+
Existing synchronous methods remain available.
|
|
176
188
|
|
|
177
189
|
License
|
|
178
190
|
-------
|
|
@@ -28,7 +28,7 @@ HerePy
|
|
|
28
28
|
Introduction
|
|
29
29
|
============
|
|
30
30
|
|
|
31
|
-
This library provides a pure Python interface for the `HERE API <https://developer.here.com/>`_. It works with Python versions 3.10 and over.
|
|
31
|
+
This library provides a pure Python interface for the `HERE API <https://developer.here.com/>`_. It supports both synchronous and asynchronous HTTP calls, and works with Python versions 3.10 and over.
|
|
32
32
|
|
|
33
33
|
`HERE <https://www.here.com/>`_ provides location based services. HERE exposes a `rest APIs <https://developer.here.com/documentation>`_ and this library is intended to make it even easier for Python programmers to use.
|
|
34
34
|
|
|
@@ -80,9 +80,17 @@ to also run code coverage::
|
|
|
80
80
|
|
|
81
81
|
$ uv run pytest --cov=herepy
|
|
82
82
|
|
|
83
|
-
To run
|
|
83
|
+
To run all checks (format, lint, type check and tests) with nox::
|
|
84
84
|
|
|
85
|
-
$
|
|
85
|
+
$ uv run nox
|
|
86
|
+
|
|
87
|
+
To run only one check, pick a session by name::
|
|
88
|
+
|
|
89
|
+
$ uv run nox -s run_tests
|
|
90
|
+
|
|
91
|
+
To see all available sessions::
|
|
92
|
+
|
|
93
|
+
$ uv run nox --list
|
|
86
94
|
|
|
87
95
|
Models
|
|
88
96
|
======
|
|
@@ -130,21 +138,23 @@ Available API clients in **herepy**::
|
|
|
130
138
|
Documentation
|
|
131
139
|
=============
|
|
132
140
|
|
|
133
|
-
View the latest herepy documentation at `https://
|
|
141
|
+
View the latest herepy documentation at `https://abdullahselek.github.io/HerePy/ <https://abdullahselek.github.io/HerePy/>`_. You can view HERE's API documentation at: `https://developer.here.com/documentation <https://developer.here.com/documentation>`_.
|
|
134
142
|
|
|
135
143
|
Using
|
|
136
144
|
=====
|
|
137
145
|
|
|
138
146
|
The library provides a Python wrapper around the HERE APIs with different data models. To get started, check out the examples in the ``examples/`` folder or
|
|
139
|
-
read the documentation at `https://
|
|
147
|
+
read the documentation at `https://abdullahselek.github.io/HerePy/ <https://abdullahselek.github.io/HerePy/>`_. All API clients need an API key which you can get from `HERE Developer Portal <https://developer.here.com/>`_.
|
|
140
148
|
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
Async API calls
|
|
150
|
+
---------------
|
|
151
|
+
|
|
152
|
+
All API clients provide asynchronous counterparts for their HTTP methods. Use the ``async_`` prefix and manage the client with ``async with``::
|
|
143
153
|
|
|
144
|
-
|
|
154
|
+
async with herepy.GeocoderApi(api_key="YOUR_API_KEY") as geocoder:
|
|
155
|
+
response = await geocoder.async_free_form("Berlin")
|
|
145
156
|
|
|
146
|
-
|
|
147
|
-
$ uv publish
|
|
157
|
+
Existing synchronous methods remain available.
|
|
148
158
|
|
|
149
159
|
License
|
|
150
160
|
-------
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://requires.io/github/abdullahselek/HerePy/requirements/?branch=master)
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
**Documentation**: <a href="https://
|
|
10
|
+
**Documentation**: <a href="https://abdullahselek.github.io/HerePy/" target="_blank">https://abdullahselek.github.io/HerePy/</a>
|
|
11
11
|
|
|
12
12
|
**Source Code**: <a href="https://github.com/abdullahselek/HerePy" target="_blank">https://github.com/abdullahselek/HerePy</a>
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
site_name: HerePy
|
|
2
|
-
site_description: A
|
|
2
|
+
site_description: A Python interface to HERE location APIs with support for synchronous and asynchronous HTTP calls.
|
|
3
3
|
site_url: https://herepy.abdullahselek.com/
|
|
4
4
|
theme:
|
|
5
5
|
name: material
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "herepy"
|
|
3
|
-
version = "3.
|
|
4
|
-
description = "A
|
|
3
|
+
version = "3.7.1"
|
|
4
|
+
description = "A Python interface to HERE location APIs with support for synchronous and asynchronous HTTP calls."
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
license = { text = "MIT License" }
|
|
@@ -24,8 +24,12 @@ classifiers = [
|
|
|
24
24
|
"Programming Language :: Python :: 3.12",
|
|
25
25
|
"Programming Language :: Python :: 3.13",
|
|
26
26
|
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Programming Language :: Python :: 3.15",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"httpx2>=2.14.0",
|
|
31
|
+
"Requests>=2.25.1,<3",
|
|
27
32
|
]
|
|
28
|
-
dependencies = ["Requests>=2.25.1,<3"]
|
|
29
33
|
|
|
30
34
|
[project.urls]
|
|
31
35
|
Repository = "https://github.com/abdullahselek/HerePy"
|
|
@@ -39,9 +43,6 @@ dev = [
|
|
|
39
43
|
"pytest-runner==6.0.1",
|
|
40
44
|
"codecov==2.1.13",
|
|
41
45
|
"responses==0.25.0",
|
|
42
|
-
"tox==4.14.2",
|
|
43
|
-
"tox-pyenv==1.1.0",
|
|
44
|
-
"flake8",
|
|
45
46
|
"nox>=2026.4.10",
|
|
46
47
|
"ruff>=0.15.16",
|
|
47
48
|
"mypy>=2.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
|
|
3
|
-
"""A
|
|
3
|
+
"""A Python interface to HERE location APIs with sync and async HTTP calls."""
|
|
4
4
|
|
|
5
5
|
__author__ = "Abdullah Selek"
|
|
6
6
|
__email__ = "abdullahselek.os@gmail.com"
|
|
@@ -9,7 +9,7 @@ __license__ = "MIT License"
|
|
|
9
9
|
__version__ = "3.6.5"
|
|
10
10
|
__url__ = "https://github.com/abdullahselek/HerePy"
|
|
11
11
|
__download_url__ = "https://pypi.org/pypi/herepy"
|
|
12
|
-
__description__ = "A
|
|
12
|
+
__description__ = "A Python interface to HERE location APIs with support for synchronous and asynchronous HTTP calls."
|
|
13
13
|
|
|
14
14
|
from .destination_weather_api import DestinationWeatherApi
|
|
15
15
|
from .error import AccessDeniedError, HEREError, InvalidRequestError, UnauthorizedError
|
|
@@ -176,3 +176,122 @@ class DestinationWeatherApi(HEREApi):
|
|
|
176
176
|
"longitude": longitude,
|
|
177
177
|
}
|
|
178
178
|
return self._get(data, product)
|
|
179
|
+
|
|
180
|
+
async def _get_async(self, data, product):
|
|
181
|
+
url = Utils.build_url(self._base_url, extra_params=data)
|
|
182
|
+
response = await self._get_async_client().get(url, timeout=self._timeout)
|
|
183
|
+
json_data = json.loads(response.content.decode("utf8"))
|
|
184
|
+
if json_data.get(self._product_node(product)) is not None:
|
|
185
|
+
return DestinationWeatherResponse.new_from_jsondict(json_data, param_defaults={self._product_node(product): None})
|
|
186
|
+
else:
|
|
187
|
+
error = self._get_error_from_response(json_data)
|
|
188
|
+
raise error
|
|
189
|
+
|
|
190
|
+
async def async_weather_for_location_name(
|
|
191
|
+
self,
|
|
192
|
+
location_name: str,
|
|
193
|
+
product: WeatherProductType,
|
|
194
|
+
one_observation: bool = True,
|
|
195
|
+
metric: bool = True,
|
|
196
|
+
) -> DestinationWeatherResponse | None:
|
|
197
|
+
"""
|
|
198
|
+
Request the product for given location name.
|
|
199
|
+
|
|
200
|
+
Args:
|
|
201
|
+
location_name (str):
|
|
202
|
+
Location name.
|
|
203
|
+
product (WeatherProductType):
|
|
204
|
+
A WeatherProductType identifying the type of report to obtain.
|
|
205
|
+
one_observation (bool):
|
|
206
|
+
Limit the result to the best mapped weather station.
|
|
207
|
+
metric (bool):
|
|
208
|
+
Use the metric system.
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
DestinationWeatherResponse
|
|
212
|
+
Raises:
|
|
213
|
+
HEREError
|
|
214
|
+
|
|
215
|
+
"""
|
|
216
|
+
data = {
|
|
217
|
+
"apiKey": self._api_key,
|
|
218
|
+
"product": product.__str__(),
|
|
219
|
+
"oneobservation": "true" if one_observation else "false",
|
|
220
|
+
"metric": "true" if metric else "false",
|
|
221
|
+
"name": location_name,
|
|
222
|
+
}
|
|
223
|
+
return await self._get_async(data, product)
|
|
224
|
+
|
|
225
|
+
async def async_weather_for_zip_code(
|
|
226
|
+
self,
|
|
227
|
+
zip_code: int,
|
|
228
|
+
product: WeatherProductType,
|
|
229
|
+
one_observation: bool = True,
|
|
230
|
+
metric: bool = True,
|
|
231
|
+
) -> DestinationWeatherResponse | None:
|
|
232
|
+
"""
|
|
233
|
+
Request the product for given zip code.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
zip_code (int):
|
|
237
|
+
U.S. zip code.
|
|
238
|
+
product (WeatherProductType):
|
|
239
|
+
A WeatherProductType identifying the type of report to obtain.
|
|
240
|
+
one_observation (bool):
|
|
241
|
+
Limit the result to the best mapped weather station.
|
|
242
|
+
metric (bool):
|
|
243
|
+
Use the metric system.
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
DestinationWeatherResponse
|
|
247
|
+
Raises:
|
|
248
|
+
HEREError
|
|
249
|
+
|
|
250
|
+
"""
|
|
251
|
+
data = {
|
|
252
|
+
"apiKey": self._api_key,
|
|
253
|
+
"product": product.__str__(),
|
|
254
|
+
"oneobservation": "true" if one_observation else "false",
|
|
255
|
+
"metric": "true" if metric else "false",
|
|
256
|
+
"zipcode": zip_code,
|
|
257
|
+
}
|
|
258
|
+
return await self._get_async(data, product)
|
|
259
|
+
|
|
260
|
+
async def async_weather_for_coordinates(
|
|
261
|
+
self,
|
|
262
|
+
latitude: float,
|
|
263
|
+
longitude: float,
|
|
264
|
+
product: WeatherProductType,
|
|
265
|
+
one_observation: bool = True,
|
|
266
|
+
metric: bool = True,
|
|
267
|
+
) -> DestinationWeatherResponse | None:
|
|
268
|
+
"""
|
|
269
|
+
Request the product for given coordinates.
|
|
270
|
+
|
|
271
|
+
Args:
|
|
272
|
+
latitude (float):
|
|
273
|
+
Latitude.
|
|
274
|
+
longitude (float):
|
|
275
|
+
Longitude.
|
|
276
|
+
product (WeatherProductType):
|
|
277
|
+
A WeatherProductType identifying the type of report to obtain.
|
|
278
|
+
one_observation (bool):
|
|
279
|
+
Limit the result to the best mapped weather station.
|
|
280
|
+
metric (bool):
|
|
281
|
+
Use the metric system.
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
DestinationWeatherResponse
|
|
285
|
+
Raises:
|
|
286
|
+
HEREError
|
|
287
|
+
|
|
288
|
+
"""
|
|
289
|
+
data = {
|
|
290
|
+
"apiKey": self._api_key,
|
|
291
|
+
"product": product.__str__(),
|
|
292
|
+
"oneobservation": "true" if one_observation else "false",
|
|
293
|
+
"metric": "true" if metric else "false",
|
|
294
|
+
"latitude": latitude,
|
|
295
|
+
"longitude": longitude,
|
|
296
|
+
}
|
|
297
|
+
return await self._get_async(data, product)
|
|
@@ -8,12 +8,13 @@ import sys
|
|
|
8
8
|
import requests
|
|
9
9
|
|
|
10
10
|
from herepy.error import HEREError
|
|
11
|
+
from herepy.here_api import HEREApi
|
|
11
12
|
from herepy.here_enum import EVStationConnectorTypes
|
|
12
13
|
from herepy.models import EVChargingStationsResponse
|
|
13
14
|
from herepy.utils import Utils
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
class EVChargingStationsApi:
|
|
17
|
+
class EVChargingStationsApi(HEREApi):
|
|
17
18
|
"""A python interface into the HERE EV Charging Stations API."""
|
|
18
19
|
|
|
19
20
|
def __init__(self, api_key: str = None, timeout: int = None):
|
|
@@ -27,11 +28,7 @@ class EVChargingStationsApi:
|
|
|
27
28
|
Timeout limit for requests.
|
|
28
29
|
|
|
29
30
|
"""
|
|
30
|
-
|
|
31
|
-
if timeout:
|
|
32
|
-
self._timeout = timeout
|
|
33
|
-
else:
|
|
34
|
-
self._timeout = 20
|
|
31
|
+
super().__init__(api_key, timeout)
|
|
35
32
|
self._base_url = "https://ev-v2.cit.cc.api.here.com/ev/"
|
|
36
33
|
|
|
37
34
|
def __get(self, base_url, data, response_cls):
|
|
@@ -261,6 +258,217 @@ class EVChargingStationsApi:
|
|
|
261
258
|
response = self.__get(url, data, EVChargingStationsResponse)
|
|
262
259
|
return response
|
|
263
260
|
|
|
261
|
+
async def __get_async(self, base_url, data, response_cls):
|
|
262
|
+
url = Utils.build_url(base_url, extra_params=data)
|
|
263
|
+
response = await self._get_async_client().get(url, timeout=self._timeout)
|
|
264
|
+
json_data = json.loads(response.content.decode("utf8"))
|
|
265
|
+
if json_data.get("evStations") is not None:
|
|
266
|
+
return response_cls.new_from_jsondict(json_data)
|
|
267
|
+
else:
|
|
268
|
+
raise error_from_ev_charging_service_error(json_data)
|
|
269
|
+
|
|
270
|
+
async def async_get_stations_circular_search(
|
|
271
|
+
self,
|
|
272
|
+
latitude: float,
|
|
273
|
+
longitude: float,
|
|
274
|
+
radius: int,
|
|
275
|
+
connectortypes: list[EVStationConnectorTypes] = None,
|
|
276
|
+
maxresults: int = 50,
|
|
277
|
+
offset: int = 0,
|
|
278
|
+
) -> EVChargingStationsResponse | None:
|
|
279
|
+
"""
|
|
280
|
+
Make a search request for charging stations.
|
|
281
|
+
|
|
282
|
+
A circular search area defined by the latitude and longitude of its center
|
|
283
|
+
(compliant with WGS 84) and an integer representing the radius of the area
|
|
284
|
+
in meters, all separated by commas.
|
|
285
|
+
|
|
286
|
+
Args:
|
|
287
|
+
latitude (float):
|
|
288
|
+
latitude.
|
|
289
|
+
longitude (float):
|
|
290
|
+
longitude.
|
|
291
|
+
radius (int):
|
|
292
|
+
Radius of circular area in meter. Radius can be a maximum of 200 km (200000).
|
|
293
|
+
connectortypes (List[EVStationConnectorTypes]):
|
|
294
|
+
Optional, to identify the connector types.
|
|
295
|
+
maxresults (int):
|
|
296
|
+
The maximum number of results a response can contain.
|
|
297
|
+
This parameter can be used with the offset parameter in the query and HasMore in the response for pagination.
|
|
298
|
+
offset (int):
|
|
299
|
+
A value specifying the index of the first result. The offset together with the
|
|
300
|
+
"maxresults" value can be used to support a paging mechanism on search results.
|
|
301
|
+
This parameter can be used with the maxresults parameter in the query and HasMore in the response for pagination.
|
|
302
|
+
|
|
303
|
+
Returns:
|
|
304
|
+
EVChargingStationsResponse
|
|
305
|
+
Raises:
|
|
306
|
+
HEREError
|
|
307
|
+
|
|
308
|
+
"""
|
|
309
|
+
if connectortypes:
|
|
310
|
+
connector_types_str = self.__connector_types_str(connectortypes)
|
|
311
|
+
data = {
|
|
312
|
+
"apiKey": self._api_key,
|
|
313
|
+
"prox": str.format("{0},{1},{2}", latitude, longitude, radius),
|
|
314
|
+
"connectortype": connector_types_str,
|
|
315
|
+
"maxresults": maxresults,
|
|
316
|
+
"offset": offset,
|
|
317
|
+
}
|
|
318
|
+
else:
|
|
319
|
+
data = {
|
|
320
|
+
"apiKey": self._api_key,
|
|
321
|
+
"prox": str.format("{0},{1},{2}", latitude, longitude, radius),
|
|
322
|
+
"maxresults": maxresults,
|
|
323
|
+
"offset": offset,
|
|
324
|
+
}
|
|
325
|
+
response = await self.__get_async(self._base_url + "stations.json", data, EVChargingStationsResponse)
|
|
326
|
+
return response
|
|
327
|
+
|
|
328
|
+
async def async_get_stations_bounding_box(
|
|
329
|
+
self,
|
|
330
|
+
top_left: list[float],
|
|
331
|
+
bottom_right: list[float],
|
|
332
|
+
connectortypes: list[EVStationConnectorTypes] = None,
|
|
333
|
+
maxresults: int = 50,
|
|
334
|
+
offset: int = 0,
|
|
335
|
+
) -> EVChargingStationsResponse | None:
|
|
336
|
+
"""
|
|
337
|
+
Search for charging stations in a bounding box.
|
|
338
|
+
|
|
339
|
+
The bounding box can have a maximum height or width of 400 km.
|
|
340
|
+
|
|
341
|
+
Args:
|
|
342
|
+
top_left (List):
|
|
343
|
+
List contains latitude and longitude in order.
|
|
344
|
+
bottom_right (List):
|
|
345
|
+
List contains latitude and longitude in order.
|
|
346
|
+
connectortypes (List[EVStationConnectorTypes]):
|
|
347
|
+
Optional, to identify the connector types.
|
|
348
|
+
maxresults (int):
|
|
349
|
+
The maximum number of results a response can contain.
|
|
350
|
+
This parameter can be used with the offset parameter in the query and HasMore in the response for pagination.
|
|
351
|
+
offset (int):
|
|
352
|
+
A value specifying the index of the first result. The offset together with the
|
|
353
|
+
"maxresults" value can be used to support a paging mechanism on search results.
|
|
354
|
+
This parameter can be used with the maxresults parameter in the query and HasMore in the response for pagination.
|
|
355
|
+
|
|
356
|
+
Returns:
|
|
357
|
+
EVChargingStationsResponse
|
|
358
|
+
Raises:
|
|
359
|
+
HEREError
|
|
360
|
+
|
|
361
|
+
"""
|
|
362
|
+
if connectortypes:
|
|
363
|
+
connector_types_str = self.__connector_types_str(connectortypes)
|
|
364
|
+
data = {
|
|
365
|
+
"apiKey": self._api_key,
|
|
366
|
+
"bbox": str.format(
|
|
367
|
+
"{0},{1};{2},{3}",
|
|
368
|
+
top_left[0],
|
|
369
|
+
top_left[1],
|
|
370
|
+
bottom_right[0],
|
|
371
|
+
bottom_right[1],
|
|
372
|
+
),
|
|
373
|
+
"connectortype": connector_types_str,
|
|
374
|
+
"maxresults": maxresults,
|
|
375
|
+
"offset": offset,
|
|
376
|
+
}
|
|
377
|
+
else:
|
|
378
|
+
data = {
|
|
379
|
+
"apiKey": self._api_key,
|
|
380
|
+
"bbox": str.format(
|
|
381
|
+
"{0},{1};{2},{3}",
|
|
382
|
+
top_left[0],
|
|
383
|
+
top_left[1],
|
|
384
|
+
bottom_right[0],
|
|
385
|
+
bottom_right[1],
|
|
386
|
+
),
|
|
387
|
+
"maxresults": maxresults,
|
|
388
|
+
"offset": offset,
|
|
389
|
+
}
|
|
390
|
+
response = await self.__get_async(self._base_url + "stations.json", data, EVChargingStationsResponse)
|
|
391
|
+
return response
|
|
392
|
+
|
|
393
|
+
async def async_get_stations_corridor(
|
|
394
|
+
self,
|
|
395
|
+
points: list[float],
|
|
396
|
+
connectortypes: list[EVStationConnectorTypes] = None,
|
|
397
|
+
maxresults: int = 50,
|
|
398
|
+
offset: int = 0,
|
|
399
|
+
) -> EVChargingStationsResponse | None:
|
|
400
|
+
"""
|
|
401
|
+
Search for charging stations along a corridor.
|
|
402
|
+
|
|
403
|
+
The maximum corridor area is 5000 km2.
|
|
404
|
+
|
|
405
|
+
Args:
|
|
406
|
+
points (List):
|
|
407
|
+
List contains latitude and longitude pairs in order.
|
|
408
|
+
connectortypes (List[EVStationConnectorTypes]):
|
|
409
|
+
Optional, to identify the connector types.
|
|
410
|
+
maxresults (int):
|
|
411
|
+
The maximum number of results a response can contain.
|
|
412
|
+
This parameter can be used with the offset parameter in the query and HasMore in the response for pagination.
|
|
413
|
+
offset (int):
|
|
414
|
+
A value specifying the index of the first result. The offset together with the
|
|
415
|
+
"maxresults" value can be used to support a paging mechanism on search results.
|
|
416
|
+
This parameter can be used with the maxresults parameter in the query and HasMore in the response for pagination.
|
|
417
|
+
|
|
418
|
+
Returns:
|
|
419
|
+
EVChargingStationsResponse
|
|
420
|
+
Raises:
|
|
421
|
+
HEREError
|
|
422
|
+
|
|
423
|
+
"""
|
|
424
|
+
if connectortypes:
|
|
425
|
+
connector_types_str = self.__connector_types_str(connectortypes)
|
|
426
|
+
data = {
|
|
427
|
+
"apiKey": self._api_key,
|
|
428
|
+
"corridor": self.__corridor_str(points),
|
|
429
|
+
"connectortype": connector_types_str,
|
|
430
|
+
"maxresults": maxresults,
|
|
431
|
+
"offset": offset,
|
|
432
|
+
}
|
|
433
|
+
else:
|
|
434
|
+
data = {
|
|
435
|
+
"apiKey": self._api_key,
|
|
436
|
+
"corridor": self.__corridor_str(points),
|
|
437
|
+
"maxresults": maxresults,
|
|
438
|
+
"offset": offset,
|
|
439
|
+
}
|
|
440
|
+
response = await self.__get_async(self._base_url + "stations.json", data, EVChargingStationsResponse)
|
|
441
|
+
return response
|
|
442
|
+
|
|
443
|
+
async def async_get_station_details(self, station_id: str, maxresults: int = 50, offset: int = 0) -> EVChargingStationsResponse | None:
|
|
444
|
+
"""
|
|
445
|
+
Retrieve the full/updated information about a single charging station only.
|
|
446
|
+
|
|
447
|
+
Based on the results of a search for charging stations, this method
|
|
448
|
+
retrieves the full/updated information about a single charging station only.
|
|
449
|
+
|
|
450
|
+
Args:
|
|
451
|
+
station_id (str):
|
|
452
|
+
station_id is an attribute of the evStation element with a unique value.
|
|
453
|
+
maxresults (int):
|
|
454
|
+
The maximum number of results a response can contain.
|
|
455
|
+
This parameter can be used with the offset parameter in the query and HasMore in the response for pagination.
|
|
456
|
+
offset (int):
|
|
457
|
+
A value specifying the index of the first result. The offset together with the
|
|
458
|
+
"maxresults" value can be used to support a paging mechanism on search results.
|
|
459
|
+
This parameter can be used with the maxresults parameter in the query and HasMore in the response for pagination.
|
|
460
|
+
|
|
461
|
+
Returns:
|
|
462
|
+
EVChargingStationsResponse
|
|
463
|
+
Raises:
|
|
464
|
+
HEREError
|
|
465
|
+
|
|
466
|
+
"""
|
|
467
|
+
data = {"apiKey": self._api_key, "maxresults": maxresults, "offset": offset}
|
|
468
|
+
url = self._base_url + "stations/" + station_id + ".json"
|
|
469
|
+
response = await self.__get_async(url, data, EVChargingStationsResponse)
|
|
470
|
+
return response
|
|
471
|
+
|
|
264
472
|
|
|
265
473
|
class UnauthorizedError(HEREError):
|
|
266
474
|
"""
|