Python API Client¶
The REST API for accessing data from academic-observatory-workflows.
The academic_observatory_api.client package is automatically generated by the OpenAPI Generator project:
API version: 1.0.0
Package version: 1.0.0
Getting Started¶
In your own code, to use this library to connect and interact with client, you can run the following:
import time
import academic_observatory_api.client
from pprint import pprint
from academic_observatory_api.client.api import academic_observatory_api
from academic_observatory_api.client.model.pit_response import PitResponse
from academic_observatory_api.client.model.query_response import QueryResponse
# Defining the host is optional and defaults to https://ao.api.observatory.academy
# See configuration.py for a list of all supported configuration parameters.
configuration = academic_observatory_api.client.Configuration(
host = "https://ao.api.observatory.academy"
)
# 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 API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Enter a context with an instance of the API client
with academic_observatory_api.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = academic_observatory_api.AcademicObservatoryApi(api_client)
agg = "author" # str | The aggregate.
index_date = dateutil_parser('1970-01-01').date() # date | Index date, defaults to latest (optional)
keep_alive = 1 # int | How long to keep the point in time id alive (in minutes) (optional)
try:
api_response = api_instance.pit_id_agg(agg, index_date=index_date, keep_alive=keep_alive)
pprint(api_response)
except academic_observatory_api.client.ApiException as e:
print("Exception when calling AcademicObservatoryApi->pit_id_agg: %s\n" % e)
Documentation for API Endpoints¶
All URIs are relative to https://ao.api.observatory.academy
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AcademicObservatoryApi | pit_id_agg | GET /v1/{agg}/pit | |
| AcademicObservatoryApi | pit_id_subagg | GET /v1/{agg}/{subagg}/pit | |
| AcademicObservatoryApi | query_agg | GET /v1/{agg} | |
| AcademicObservatoryApi | query_subagg | GET /v1/{agg}/{subagg} |
Documentation For Models¶
Documentation For Authorization¶
api_key¶
Type: API key
API key parameter name: key
Location: URL query string