GIDEON API Query Wrapper¶
- gideon_api.set_api_key(api_key)¶
Sets the GIDEON API key
- Return type
None
- gideon_api.query(api_path, params=None, try_dataframe=True, force_online=False, cache_expiration_hours=24)¶
Query GIDEON API and automatically handles local caching and data type conversion.
- Parameters
api_path (
str
) – The API path as stated in the API documentation.params (
Optional
[Dict
[str
,Union
[str
,int
]]]) – Optional key-value pairs to attach as URL parameters.try_dataframe (
bool
) – If possible, converts output data to pandas dataframe.force_online (
bool
) – Forces the query to the server, regardless of cache status.cache_expiration_hours (
Optional
[int
]) – Sets the time, in hours, after which a response will expire from the cache.
- Returns
The API response will be returned as a DataFrame if try_dataframe is True and is applicable to the response data or a Python dictionary representing the JSON data.
- Return type
DataFrame or Python dictionary
- gideon_api.query_online(path, params=None, return_response_object=False)¶
Queries the GIDEON API and forces a call to the server and ignores local caching.
- Parameters
path (
str
) – The API path as stated in the API documentation.params (
Optional
[Dict
[str
,Union
[str
,int
]]]) – Optional key-value pairs to attach as URL parameters.return_response_object (
bool
) – Indicates if the raw requests object should be returned rather than just the data.
- Returns
Depending on the return_response_object variable, either a Python dictionary of the returned data or a requests.Response object of the call.
- Return type
Python dictionary or requests.Response object