Session
Main user-facing session class for interacting with the OpenAIRE Graph API and Scholexplorer.
AireloomSession
High-level session manager for interacting with OpenAIRE APIs.
This class acts as the primary entry point for users of the aireloom
library.
It provides convenient access to various OpenAIRE resource clients (e.g., for
research products, projects) through an underlying AireloomClient
instance.
The session handles the lifecycle of the AireloomClient
, including its
creation with appropriate settings (like timeouts and authentication) and
its proper closure when the session is no longer needed. It supports
asynchronous context management (async with
).
Example:
async with AireloomSession(timeout=60) as session:
product = await session.research_products.get("some_id")
# ... further API calls
Attributes:
Name | Type | Description |
---|---|---|
research_products |
ResearchProductsClient
|
Client for research product APIs. |
organizations |
OrganizationsClient
|
Client for organization APIs. |
projects |
ProjectsClient
|
Client for project APIs. |
data_sources |
DataSourcesClient
|
Client for data source APIs. |
scholix |
ScholixClient
|
Client for Scholix (scholarly link) APIs. |
_api_client |
AireloomClient
|
The underlying client instance. |
Source code in src/aireloom/session.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
data_sources
property
Access the DataSourcesClient.
organizations
property
Access the OrganizationsClient.
projects
property
Access the ProjectsClient.
research_products
property
Access the ResearchProductsClient.
scholix
property
Access the ScholixClient.
__init__(auth_strategy=None, timeout=None, api_base_url=None, scholix_base_url=None)
Initializes the Aireloom session and its underlying AireloomClient
.
The session allows for overriding certain configurations like request timeout
and API base URLs. Authentication strategy can also be provided directly.
If not provided, the AireloomClient
will attempt to determine it based
on its own settings (loaded from environment or .env files).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_strategy
|
AuthStrategy | None
|
An optional |
None
|
timeout
|
int | None
|
An optional integer to override the default request timeout
(in seconds) for all HTTP requests made during this session.
If |
None
|
api_base_url
|
str | None
|
An optional string to override the default base URL for the OpenAIRE Graph API. |
None
|
scholix_base_url
|
str | None
|
An optional string to override the default base URL for the OpenAIRE Scholix API. |
None
|
Source code in src/aireloom/session.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
close()
async
Closes the underlying HTTP client session.
Source code in src/aireloom/session.py
131 132 133 |
|