Skip to content

Latest commit

 

History

History

cape-of-good-place-names-client

This is a stateless service for performing various geotranslation operations, moving between how people describe places and codified coordinate systems.

This Python package is automatically generated by the OpenAPI Generator project:

Requirements.

Python >= 3.6

Installation & Usage

pip install

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

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import cape_of_good_place_names_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import cape_of_good_place_names_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import cape_of_good_place_names_client
from pprint import pprint
from cape_of_good_place_names_client.api import default_api
from cape_of_good_place_names_client.model.error import Error
from cape_of_good_place_names_client.model.geocode_results import GeocodeResults
from cape_of_good_place_names_client.model.geolookup_results import GeolookupResults
from cape_of_good_place_names_client.model.scrub_results import ScrubResults
# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = cape_of_good_place_names_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration = cape_of_good_place_names_client.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)


# Enter a context with an instance of the API client
with cape_of_good_place_names_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)
    address = "address_example" # str | Free form address string to geocode
geocoders = [
        "geocoders_example",
    ] # [str] | ID of Geocoders that should be used (optional)

    try:
        # Translate a free form address into a spatial coordinate
        api_response = api_instance.geocode(address, geocoders=geocoders)
        pprint(api_response)
    except cape_of_good_place_names_client.ApiException as e:
        print("Exception when calling DefaultApi->geocode: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:8000

Class Method HTTP request Description
DefaultApi geocode GET /v1.1/geocode Translate a free form address into a spatial coordinate
DefaultApi geocode_v1 GET /v1/geocode Translate a free form address into a spatial coordinate
DefaultApi geocoders GET /v1.1/geocoders Return list of supported geocoder IDs
DefaultApi geolookup GET /v1/boundary_lookup Translate a spatial identifier into a description of space
DefaultApi scrub GET /v1/scrub Extract meaningful phrases or identifiers from free form addresses

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Author

opmdata+cogpn-support@capetown.gov.za

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in cape_of_good_place_names_client.apis and cape_of_good_place_names_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from cape_of_good_place_names_client.api.default_api import DefaultApi
  • from cape_of_good_place_names_client.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import cape_of_good_place_names_client
from cape_of_good_place_names_client.apis import *
from cape_of_good_place_names_client.models import *