API Reference
This section provides a basic API reference generated from the docstrings in the AIREloom library using mkdocstrings.
AireloomSession
The main session class for interacting with AIREloom.
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
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
_api_client = AireloomClient(settings=session_specific_settings, auth_strategy=auth_strategy, base_url=_api_base_url, scholix_base_url=_scholix_base_url)
instance-attribute
queries
property
Access convenience query functions.
Returns a _QueryAccessor bound to this session so you can call any
convenience function without passing the session explicitly::
papers = await session.queries.publications_by_doi(
"10.1234/..."
)
__aenter__()
async
Source code in src/aireloom/session.py
152 153 | |
__aexit__(exc_type, exc_val, exc_tb)
async
Source code in src/aireloom/session.py
155 156 | |
__dir__()
Source code in src/aireloom/session.py
145 146 | |
__getattr__(name)
Source code in src/aireloom/session.py
140 141 142 143 | |
__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
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 | |
close()
async
Closes the underlying HTTP client session.
Source code in src/aireloom/session.py
148 149 150 | |
Resource Clients
Clients for specific OpenAIRE API endpoints.
ResearchProductsClient
For accessing research products (publications, datasets, software, etc.) and relation links.
Bases: GraphV3FilterSerializationMixin, BatchMixin, GettableMixin, SearchableMixin, CursorIterableMixin, BaseResourceClient
Client for the OpenAIRE Research Products API endpoint.
This client provides standardized methods (get, search, iterate) for
accessing research product data, by inheriting from bibliofabric mixins.
It also provides search_links, iterate_links, and get_relations_info
for the V3 /research-products/links sub-endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for research products. |
_entity_model |
type[ResearchProduct]
|
Pydantic model for a single research product. |
_search_response_model |
type[ResearchProductResponse]
|
Pydantic model for the search response envelope. |
Source code in src/aireloom/resources/research_products_client.py
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
search_links(*, filters=None, page=0, page_size=20)
async
Search for relation links between research products.
Uses the V3 /research-products/links endpoint (NOT the Scholix API).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
LinksFilters | None
|
Optional :class: |
None
|
page
|
int
|
0-indexed page number. |
0
|
page_size
|
int
|
Number of results per page (max 99; values >=100 are silently truncated to 10 by V3). |
20
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
LinksResponse
|
class: |
Source code in src/aireloom/resources/research_products_client.py
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 | |
iterate_links(*, filters=None, page_size=MAX_LINK_PAGE_SIZE)
async
Iterate through all relation links matching filters.
Automatically handles page-based pagination using totalPages
from the response header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
LinksFilters | None
|
Optional :class: |
None
|
page_size
|
int
|
Number of results per page (max 99; see :meth: |
MAX_LINK_PAGE_SIZE
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[Relation]
|
class: |
Source code in src/aireloom/resources/research_products_client.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
get_relations_info()
async
Retrieve available relation types from the links endpoint.
Uses the V3 /research-products/links/relations-info endpoint.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
A list of dicts describing relation types (name, inverse, description). |
Source code in src/aireloom/resources/research_products_client.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
OrganizationsClient
For accessing organization data.
Bases: StandardResourceClient
Client for the OpenAIRE Organizations API endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for organizations. |
_entity_model |
type[Organization]
|
Pydantic model for a single organization. |
_search_response_model |
type[OrganizationResponse]
|
Pydantic model for the search response envelope. |
Source code in src/aireloom/resources/organizations_client.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
ProjectsClient
For accessing research project data.
Bases: StandardResourceClient
Client for the OpenAIRE Projects API endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for projects. |
_entity_model |
type[Project]
|
Pydantic model for a single project. |
_search_response_model |
type[ProjectResponse]
|
Pydantic model for the search response envelope. |
Source code in src/aireloom/resources/projects_client.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
DataSourcesClient
For accessing data source information.
Bases: StandardResourceClient
Client for the OpenAIRE Data Sources API endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for data sources. |
_entity_model |
type[DataSource]
|
Pydantic model for a single data source. |
_search_response_model |
type[DataSourceResponse]
|
Pydantic model for the search response envelope. |
Source code in src/aireloom/resources/data_sources_client.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
PersonsClient
For accessing person data.
Bases: StandardResourceClient
Client for the OpenAIRE Persons API endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for persons. |
_entity_model |
type[Person]
|
Pydantic model for a single person. |
_search_response_model |
type[PersonResponse]
|
Pydantic model for the search response envelope. |
Source code in src/aireloom/resources/persons_client.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
ScholixClient
For accessing Scholix link data via the Scholexplorer API.
Bases: BaseResourceClient
Client for the OpenAIRE Scholexplorer API (Scholix links).
This client handles requests to the Scholix API, which provides data on
relationships between research artifacts (e.g., citations, supplements).
It uses a specific base URL (_base_url_override) and custom methods
(search_links, iterate_links) tailored to the Scholix API's structure,
including its 0-indexed pagination and specific request parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
_entity_path |
str
|
The API path for Scholix links (typically "Links"). |
_base_url_override |
str
|
The base URL for the Scholexplorer API. |
_endpoint_def |
dict
|
Configuration for this endpoint from |
Source code in src/aireloom/resources/scholix_client.py
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
search(page=0, page_size=DEFAULT_PAGE_SIZE, filters=None, sort_by=None, search=None)
async
Alias for search_links so collect/count can find it.
Source code in src/aireloom/resources/scholix_client.py
249 250 251 252 253 254 255 256 257 258 | |
search_links(page=0, page_size=DEFAULT_PAGE_SIZE, filters=None)
async
Searches for Scholexplorer relationship links.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int
|
The page number to retrieve (0-indexed). |
0
|
page_size
|
int
|
The number of results per page (max 99; values >=100 are silently truncated to 10 by V3). |
DEFAULT_PAGE_SIZE
|
filters
|
ScholixFilters | None
|
An instance of ScholixFilters with filter criteria.
|
None
|
Returns:
| Type | Description |
|---|---|
ScholixResponse
|
A ScholixResponse object containing the results for the requested page. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither sourcePid nor targetPid is provided in the filters model. |
BibliofabricError
|
For API communication errors or unexpected issues. |
Source code in src/aireloom/resources/scholix_client.py
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
iterate_links(page_size=DEFAULT_PAGE_SIZE, filters=None)
async
Iterates through all Scholexplorer relationship links matching the filters.
Handles pagination automatically based on 'total_pages'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_size
|
int
|
The number of results per page during iteration. |
DEFAULT_PAGE_SIZE
|
filters
|
ScholixFilters | None
|
An instance of ScholixFilters with filter criteria.
|
None
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[ScholixRelationship]
|
ScholixRelationship objects matching the query. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither sourcePid nor targetPid is provided in the filters. |
BibliofabricError
|
For API communication errors or unexpected issues. |
Source code in src/aireloom/resources/scholix_client.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
iterate(page_size=DEFAULT_PAGE_SIZE, filters=None, sort_by=None, search=None)
async
Alias for iterate_links so collect/count can find it.
Source code in src/aireloom/resources/scholix_client.py
260 261 262 263 264 265 266 267 268 269 | |