Skip to content

Instantly share code, notes, and snippets.

@namsor
Created June 3, 2019 14:54
Show Gist options
  • Save namsor/3d67fc60b2a6aa2b2f7393d50e6b7476 to your computer and use it in GitHub Desktop.
Save namsor/3d67fc60b2a6aa2b2f7393d50e6b7476 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = openapi_client.Configuration()
configuration.api_key['X-API-KEY'] = '<your API key>'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'
# create an instance of the API class
api_instance = openapi_client.PersonalApi(openapi_client.ApiClient(configuration))
batch_first_last_name_in = openapi_client.BatchFirstLastNameIn() # BatchFirstLastNameIn | A list of personal names (optional)
name1 = openapi_client.FirstLastNameIn();
name1.id='1'
name1.first_name='John'
name1.last_name='Smith'
name2 = openapi_client.FirstLastNameIn();
name2.id='2'
name2.first_name='Mary'
name2.last_name='Smith'
batch_first_last_name_in.personal_names = [name1, name2]
try:
# Infer the likely origin of up to 1000 names, detecting automatically the cultural context.
api_response = api_instance.origin_batch(batch_first_last_name_in=batch_first_last_name_in)
pprint(api_response)
except ApiException as e:
print("Exception when calling PersonalApi->gender_batch: %s\n" % e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment