Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
*.mo
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.3
4.2.3
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ python:
- "3.3"
- "3.4"
- "3.5"
#- "3.5-dev" # 3.5 development branch
#- "nightly" # points to the latest development branch e.g. 3.6-dev
- "3.6"
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
Expand Down
54 changes: 35 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# locationiq
# openapi-client
LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.1
- API version: 2.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

Expand All @@ -14,16 +14,16 @@ Python 2.7 and 3.4+
## Installation & Usage
### pip install

If the python package is hosted on Github, you can install directly from Github
If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/location-iq/locationiq-python-client.git
pip install git+https://github.com/crystHopeunwired/locationiq-python-client.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/location-iq/locationiq-python-client.git`)
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/crystHopeunwired/locationiq-python-client.git`)

Then import the package:
```python
import locationiq
import openapi_client
```

### Setuptools
Expand All @@ -37,7 +37,7 @@ python setup.py install --user

Then import the package:
```python
import locationiq
import openapi_client
```

## Getting Started
Expand All @@ -47,25 +47,29 @@ Please follow the [installation procedure](#installation--usage) and then run th
```python
from __future__ import print_function
import time
import locationiq
from locationiq.rest import ApiException
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

configuration = openapi_client.Configuration()
# Configure API key authorization: key
configuration = locationiq.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = locationiq.BalanceApi(locationiq.ApiClient(configuration))

try:
api_response = api_instance.balance()
pprint(api_response)
except ApiException as e:
print("Exception when calling BalanceApi->balance: %s\n" % e)

# Defining host is optional and default to https://eu1.locationiq.com/v1
configuration.host = "https://eu1.locationiq.com/v1"
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.BalanceApi(api_client)

try:
api_response = api_instance.balance()
pprint(api_response)
except ApiException as e:
print("Exception when calling BalanceApi->balance: %s\n" % e)

```

## Documentation for API Endpoints
Expand All @@ -75,6 +79,10 @@ All URIs are relative to *https://eu1.locationiq.com/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BalanceApi* | [**balance**](docs/BalanceApi.md#balance) | **GET** /balance.php |
*DirectionsApi* | [**directions**](docs/DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service
*MatchingApi* | [**matching**](docs/MatchingApi.md#matching) | **GET** /matching/driving/{coordinates} | Matching Service
*MatrixApi* | [**matrix**](docs/MatrixApi.md#matrix) | **GET** /matrix/driving/{coordinates} | Matrix Service
*NearestApi* | [**nearest**](docs/NearestApi.md#nearest) | **GET** /nearest/driving/{coordinates} | Nearest Service
*SearchApi* | [**search**](docs/SearchApi.md#search) | **GET** /search.php | Forward Geocoding
*ReverseApi* | [**reverse**](docs/ReverseApi.md#reverse) | **GET** /reverse.php | Reverse Geocoding

Expand All @@ -84,8 +92,16 @@ Class | Method | HTTP request | Description
- [Address](docs/Address.md)
- [Balance](docs/Balance.md)
- [Daybalance](docs/Daybalance.md)
- [DirectionsDirections](docs/DirectionsDirections.md)
- [DirectionsDirectionsRoutes](docs/DirectionsDirectionsRoutes.md)
- [DirectionsMatching](docs/DirectionsMatching.md)
- [DirectionsMatrix](docs/DirectionsMatrix.md)
- [DirectionsMatrixSources](docs/DirectionsMatrixSources.md)
- [DirectionsNearest](docs/DirectionsNearest.md)
- [DirectionsNearestWaypoints](docs/DirectionsNearestWaypoints.md)
- [Error](docs/Error.md)
- [Location](docs/Location.md)
- [Matchquality](docs/Matchquality.md)
- [Namedetails](docs/Namedetails.md)


Expand Down
42 changes: 29 additions & 13 deletions docs/BalanceApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# locationiq.BalanceApi
# openapi_client.BalanceApi

All URIs are relative to *https://eu1.locationiq.com/v1*

Expand All @@ -15,27 +15,32 @@ Method | HTTP request | Description
The Balance API provides a count of request credits left in the user's account for the day. Balance is reset at midnight UTC everyday (00:00 UTC).

### Example

* Api Key Authentication (key):
```python
from __future__ import print_function
import time
import locationiq
from locationiq.rest import ApiException
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

configuration = openapi_client.Configuration()
# Configure API key authorization: key
configuration = locationiq.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = locationiq.BalanceApi(locationiq.ApiClient(configuration))

try:
api_response = api_instance.balance()
pprint(api_response)
except ApiException as e:
print("Exception when calling BalanceApi->balance: %s\n" % e)
# Defining host is optional and default to https://eu1.locationiq.com/v1
configuration.host = "https://eu1.locationiq.com/v1"
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.BalanceApi(api_client)

try:
api_response = api_instance.balance()
pprint(api_response)
except ApiException as e:
print("Exception when calling BalanceApi->balance: %s\n" % e)
```

### Parameters
Expand All @@ -54,5 +59,16 @@ This endpoint does not need any parameter.
- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | The request has been made from an unauthorized domain. | - |
**404** | No location or places were found for the given input | - |
**429** | Request exceeded the rate-limits set on your account | - |
**500** | Internal Server Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

101 changes: 101 additions & 0 deletions docs/DirectionsApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# openapi_client.DirectionsApi

All URIs are relative to *https://eu1.locationiq.com/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**directions**](DirectionsApi.md#directions) | **GET** /directions/driving/{coordinates} | Directions Service


# **directions**
> DirectionsDirections directions(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, alternatives=alternatives, steps=steps, annotations=annotations, geometries=geometries, overview=overview, continue_straight=continue_straight)

Directions Service

Finds the fastest route between coordinates in the supplied order.

### Example

* Api Key Authentication (key):
```python
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
configuration = openapi_client.Configuration()
# Configure API key authorization: key
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# Defining host is optional and default to https://eu1.locationiq.com/v1
configuration.host = "https://eu1.locationiq.com/v1"
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.DirectionsApi(api_client)
coordinates = '\"-0.16102,51.523854;-0.15797,51.52326;-0.161593,51.522550\"' # str | String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5
bearings = '\"10,20;40,30;30,9\"' # str | Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 (optional)
radiuses = '\"500;200;300\"' # str | Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) (optional)
generate_hints = '\"false\"' # str | Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String (optional)
approaches = '\"curb;curb;curb\"' # str | Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) (optional)
exclude = '\"toll\"' # str | Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. (optional)
alternatives = 0 # float | Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] (optional)
steps = '\"true\"' # str | Returned route steps for each route leg [ true, false (default) ] (optional)
annotations = '"false"' # str | Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] (optional) (default to '"false"')
geometries = '"polyline"' # str | Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] (optional) (default to '"polyline"')
overview = '"simplified"' # str | Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] (optional) (default to '"simplified"')
continue_straight = '"default"' # str | Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] (optional) (default to '"default"')

try:
# Directions Service
api_response = api_instance.directions(coordinates, bearings=bearings, radiuses=radiuses, generate_hints=generate_hints, approaches=approaches, exclude=exclude, alternatives=alternatives, steps=steps, annotations=annotations, geometries=geometries, overview=overview, continue_straight=continue_straight)
pprint(api_response)
except ApiException as e:
print("Exception when calling DirectionsApi->directions: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**coordinates** | **str**| String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}) or polyline6({polyline6}). polyline follows Google's polyline format with precision 5 |
**bearings** | **str**| Limits the search to segments with given bearing in degrees towards true north in clockwise direction. List of positive integer pairs separated by semi-colon and bearings array should be equal to length of coordinate array. Input Value :- {bearing};{bearing}[;{bearing} ...] Bearing follows the following format : bearing {value},{range} integer 0 .. 360,integer 0 .. 180 | [optional]
**radiuses** | **str**| Limits the search to given radius in meters Radiuses array length should be same as coordinates array, eaach value separated by semi-colon. Input Value - {radius};{radius}[;{radius} ...] Radius has following format :- double >= 0 or unlimited (default) | [optional]
**generate_hints** | **str**| Adds a Hint to the response which can be used in subsequent requests, see hints parameter. Input Value - true (default), false Format - Base64 String | [optional]
**approaches** | **str**| Keep waypoints on curb side. Input Value - {approach};{approach}[;{approach} ...] Format - curb or unrestricted (default) | [optional]
**exclude** | **str**| Additive list of classes to avoid, order does not matter. input Value - {class}[,{class}] Format - A class name determined by the profile or none. | [optional]
**alternatives** | **float**| Search for alternative routes. Passing a number alternatives=n searches for up to n alternative routes. [ true, false (default), or Number ] | [optional]
**steps** | **str**| Returned route steps for each route leg [ true, false (default) ] | [optional]
**annotations** | **str**| Returns additional metadata for each coordinate along the route geometry. [ true, false (default), nodes, distance, duration, datasources, weight, speed ] | [optional] [default to '"false"']
**geometries** | **str**| Returned route geometry format (influences overview and per step) [ polyline (default), polyline6, geojson ] | [optional] [default to '"polyline"']
**overview** | **str**| Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. [ simplified (default), full, false ] | [optional] [default to '"simplified"']
**continue_straight** | **str**| Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile [ default (default), true, false ] | [optional] [default to '"default"']

### Return type

[**DirectionsDirections**](DirectionsDirections.md)

### Authorization

[key](../README.md#key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | The request has been made from an unauthorized domain. | - |
**404** | No location or places were found for the given input | - |
**429** | Request exceeded the rate-limits set on your account | - |
**500** | Internal Server Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

12 changes: 12 additions & 0 deletions docs/DirectionsDirections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DirectionsDirections

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | | [optional]
**waypoints** | **list[object]** | | [optional]
**routes** | [**list[DirectionsDirectionsRoutes]**](DirectionsDirectionsRoutes.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


15 changes: 15 additions & 0 deletions docs/DirectionsDirectionsRoutes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# DirectionsDirectionsRoutes

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**legs** | **list[object]** | | [optional]
**weight_name** | **str** | | [optional]
**geometry** | **str** | | [optional]
**weight** | **float** | | [optional]
**distance** | **float** | | [optional]
**duration** | **float** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/DirectionsMatching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DirectionsMatching

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | | [optional]
**tracepoints** | **list[object]** | | [optional]
**matchings** | **list[object]** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


14 changes: 14 additions & 0 deletions docs/DirectionsMatrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# DirectionsMatrix

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | | [optional]
**distances** | **list[float]** | | [optional]
**fallback_speed_cells** | **list[float]** | | [optional]
**sources** | [**list[DirectionsMatrixSources]**](DirectionsMatrixSources.md) | | [optional]
**destinations** | [**list[DirectionsMatrixSources]**](DirectionsMatrixSources.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/DirectionsMatrixSources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DirectionsMatrixSources

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**distance** | **float** | | [optional]
**location** | **list[float]** | | [optional]
**name** | **str** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 11 additions & 0 deletions docs/DirectionsNearest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# DirectionsNearest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **str** | | [optional]
**waypoints** | [**list[DirectionsNearestWaypoints]**](DirectionsNearestWaypoints.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading