API Reference
This section provides a basic API reference generated from the docstrings in the AIREloom library using mkdocs-python-extractor
.
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
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 |
|
Resource Clients
Clients for specific OpenAIRE API endpoints.
ResearchProductsClient
For accessing research products (publications, datasets, software, etc.).
Bases: 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 is configured with the specific API path and Pydantic models relevant
to OpenAIRE research products.
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. |
_valid_sort_fields |
set[str]
|
A set of field names that are valid for sorting results from this endpoint. |
Source code in src/aireloom/resources/research_products_client.py
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 |
|
__init__(api_client)
Initializes the ResearchProductsClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/research_products_client.py
56 57 58 59 60 61 62 63 64 65 |
|
OrganizationsClient
For accessing organization data.
Bases: BaseResourceClient
Client for the OpenAIRE Organizations API endpoint.
This client provides methods to retrieve individual organizations (get
),
search for organizations based on filters (search
), and iterate through
all organizations (iterate
). It currently uses custom implementations for these
methods rather than directly using the generic mixins from bibliofabric.resources
.
Attributes:
Name | Type | Description |
---|---|---|
_entity_path |
str
|
The API path for organizations. |
_entity_model |
type[Organization]
|
Pydantic model for a single organization. |
_response_model |
type[OrganizationResponse]
|
Pydantic model for the search response envelope. |
_endpoint_def |
dict
|
Configuration for this endpoint from |
_valid_sort_fields |
set[str]
|
Valid sort fields for this endpoint. |
Source code in src/aireloom/resources/organizations_client.py
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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
__init__(api_client)
Initializes the OrganizationsClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/organizations_client.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
get(org_id)
async
Retrieves a single Organization by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
org_id
|
str
|
The ID of the organization. |
required |
Returns:
Type | Description |
---|---|
Organization
|
An Organization object. |
Source code in src/aireloom/resources/organizations_client.py
216 217 218 219 220 221 222 223 224 225 226 |
|
iterate(page_size=100, sort_by=None, filters=None)
async
Iterates through all Organization results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_size
|
int
|
Number of results per page during iteration. |
100
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
OrganizationsFilters | None
|
An instance of OrganizationsFilters with filter criteria. |
None
|
Yields:
Type | Description |
---|---|
AsyncIterator[Organization]
|
Organization objects. |
Source code in src/aireloom/resources/organizations_client.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
search(page=1, page_size=DEFAULT_PAGE_SIZE, sort_by=None, filters=None)
async
Searches for Organizations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int
|
Page number (1-indexed). |
1
|
page_size
|
int
|
Number of results per page. |
DEFAULT_PAGE_SIZE
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
OrganizationsFilters | None
|
An instance of OrganizationsFilters with filter criteria. |
None
|
Returns:
Type | Description |
---|---|
OrganizationResponse
|
An OrganizationResponse object. |
Source code in src/aireloom/resources/organizations_client.py
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 |
|
ProjectsClient
For accessing research project data.
Bases: GettableMixin
, SearchableMixin
, CursorIterableMixin
, BaseResourceClient
Client for the OpenAIRE Projects API endpoint.
This client offers standardized methods (get
, search
, iterate
) for
accessing project data by inheriting from bibliofabric
mixins.
It is configured with the API path and Pydantic models specific to
OpenAIRE project entities.
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. |
_valid_sort_fields |
set[str]
|
Valid sort fields for this endpoint. |
Source code in src/aireloom/resources/projects_client.py
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 |
|
__init__(api_client)
Initializes the ProjectsClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/projects_client.py
58 59 60 61 62 63 64 65 |
|
DataSourcesClient
For accessing data source information.
Bases: BaseResourceClient
Client for the OpenAIRE Data Sources API endpoint.
This client allows interaction with OpenAIRE's data source entities,
offering methods for retrieval (get
), searching (search
), and iteration
(iterate
). It currently employs custom logic for these operations.
Attributes:
Name | Type | Description |
---|---|---|
_entity_path |
str
|
The API path for data sources. |
_entity_model |
type[DataSource]
|
Pydantic model for a single data source. |
_response_model |
type[DataSourceResponse]
|
Pydantic model for the search response envelope. |
_endpoint_def |
dict
|
Configuration for this endpoint from |
_valid_sort_fields |
set[str]
|
Valid sort fields for this endpoint. |
Source code in src/aireloom/resources/data_sources_client.py
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 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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
__init__(api_client)
Initializes the DataSourcesClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/data_sources_client.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
get(source_id)
async
Retrieves a single Data Source by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_id
|
str
|
The ID of the data source. |
required |
Returns:
Type | Description |
---|---|
DataSource
|
A DataSource object. |
Source code in src/aireloom/resources/data_sources_client.py
211 212 213 214 215 216 217 218 219 220 221 |
|
iterate(page_size=100, sort_by=None, filters=None)
async
Iterates through all Data Source results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_size
|
int
|
Number of results per page during iteration. |
100
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
DataSourcesFilters | None
|
An instance of DataSourcesFilters with filter criteria. |
None
|
Yields:
Type | Description |
---|---|
AsyncIterator[DataSource]
|
DataSource objects. |
Source code in src/aireloom/resources/data_sources_client.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
search(page=1, page_size=DEFAULT_PAGE_SIZE, sort_by=None, filters=None)
async
Searches for Data Sources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int
|
Page number (1-indexed). |
1
|
page_size
|
int
|
Number of results per page. |
DEFAULT_PAGE_SIZE
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
DataSourcesFilters | None
|
An instance of DataSourcesFilters with filter criteria. |
None
|
Returns:
Type | Description |
---|---|
DataSourceResponse
|
A DataSourceResponse object. |
Source code in src/aireloom/resources/data_sources_client.py
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 |
|
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 (_scholix_base_url
) 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"). |
_scholix_base_url |
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
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 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 |
|
__init__(api_client, scholix_base_url=None)
Initializes the ScholixClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of |
required |
scholix_base_url
|
str | None
|
Optional base URL for the Scholexplorer API. If None,
the default from |
None
|
Source code in src/aireloom/resources/scholix_client.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
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
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 |
|
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. |
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
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 |
|
Note: For this extractor to work, the specified Python modules and classes must have docstrings. The level of detail in this API reference depends directly on the comprehensiveness of those docstrings.