API reference
Generated from the docstrings with mkdocstrings.
Client
aireloom.AireloomClient
Bases: BaseApiClient
Client for the OpenAIRE Graph API (V4) and the Scholexplorer API.
Entity resources are available as typed attributes; single-entity lookups
go through the V3 by-id routes because V4 has none. Authentication
resolves in the constructor: set openaire_refresh_token /
refresh_token for OAuth2 refresh-token access, or set both
openaire_client_id and openaire_client_secret (settings,
AIRELOOM_OPENAIRE_CLIENT_ID / AIRELOOM_OPENAIRE_CLIENT_SECRET, or
client_id / client_secret) for OAuth2 client-credentials access
against the Keycloak token endpoint; partial client credentials raise
:class:ConfigurationError, and without credentials the client is
anonymous. An explicit auth_strategy always wins.
The Scholix resource talks to the Scholexplorer host through a second internal client that shares settings and credentials but throttles itself to one request per second. See the package README and docs for usage examples of both the async and the sync variants.
Source code in packages/aireloom/src/aireloom/_async/client.py
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 | |
request(method, path, *, params=None, json=None, data=None, content=None, headers=None, timeout=None, retry=None, follow_redirects=None)
async
Send a request through the core retry pipeline.
V4 accepts mailto for polite-pool admission (V3 rejects it), so the
configured contact address is attached to v4/ requests only.
Source code in packages/aireloom/src/aireloom/_async/client.py
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 | |
aclose()
async
Close both the Graph and the Scholix HTTP clients.
Source code in packages/aireloom/src/aireloom/_async/client.py
235 236 237 238 239 240 | |
Settings
aireloom.AireloomSettings
Bases: BaseApiSettings
Tunable client behavior for the OpenAIRE Graph and Scholexplorer APIs.
Every field can be set through an environment variable prefixed with
AIRELOOM_ (for example AIRELOOM_OPENAIRE_CLIENT_ID) or a .env
file in the working directory.
Source code in packages/aireloom/src/aireloom/config.py
19 20 21 22 23 24 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 | |
Resources
aireloom.ResearchProductsResource
Bases: GraphResource[ResearchProduct]
V4 research products endpoint: search, iterate, count, facets, group_by.
get(id) reads the V3 by-id route because V4 has no by-id endpoints.
Batch lookups use OR expressions over id and ids.doi.
Source code in packages/aireloom/src/aireloom/_async/resources.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
batch_get_by_doi(dois, *, batch_size=None, concurrency=4)
async
Fetch research products for many DOIs in bounded, concurrent chunks.
Keys are bare, lowercased DOIs; missing DOIs are absent from the
result. The request goes out as filter=ids.doi:a|b|c.
Source code in packages/aireloom/src/aireloom/_async/resources.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
by_orcid(orcid, *, limit=100)
async
Return research products whose authorship carries orcid.
Accepts any spelling bibliofabric.ids.normalize_orcid handles
(bare, dashed, or an https://orcid.org/ URL); the filter sends
the hyphenated form via the V4 authorships.author.orcid field and
paginates via cursor when limit exceeds 100.
Source code in packages/aireloom/src/aireloom/_async/resources.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
get_fields(ids, fields, *, batch_size=None, concurrency=4)
async
Sparse-fetch fields for known ids in bounded, concurrent chunks.
Combines the V4 select parameter with an id OR-filter (at most
50 ids per chunk). The returned records carry only the requested
fields; every other model field stays at its default.
Source code in packages/aireloom/src/aireloom/_async/resources.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | |
get_relations_info()
async
Return the relation types the links endpoint can produce.
Source code in packages/aireloom/src/aireloom/_async/resources.py
499 500 501 | |
iterate_links(filters=None, *, page_size=None, limit=None, on_error='raise', failures=None, on_page=None)
Iterate over all relations matching filters, 99 per page.
See :class:LinksResource for the missing-sort hazard of this
page-based route.
Source code in packages/aireloom/src/aireloom/_async/resources.py
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
search_links(filters=None, *, page=None, page_size=None)
async
Fetch one page of relations from the Graph links route.
Source code in packages/aireloom/src/aireloom/_async/resources.py
465 466 467 468 469 470 471 472 473 | |
aireloom.ProjectsResource
Bases: GraphResource[Project]
V4 projects endpoint: search, iterate, count, facets, group_by.
get(id) reads the V3 by-id route because V4 has no by-id endpoints.
Source code in packages/aireloom/src/aireloom/_async/resources.py
309 310 311 312 313 314 315 316 317 318 | |
aireloom.OrganizationsResource
Bases: GraphResource[Organization]
V4 organizations endpoint: search, iterate, count, facets, group_by.
get(id) reads the V3 by-id route because V4 has no by-id endpoints.
Source code in packages/aireloom/src/aireloom/_async/resources.py
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 | |
find_variants(names, *, country=None, page_size=None)
async
Search each name fragment and return deduplicated organizations.
Records are deduplicated by exact id keeping the first match;
pending_org_:: records are kept on purpose. They carry
organization-project links that the canonical merged record lost,
which makes them the main source of undercounted org-project
links, so callers decide how to merge them.
Source code in packages/aireloom/src/aireloom/_async/resources.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
aireloom.DataSourcesResource
Bases: GraphResource[DataSource]
V4 data sources endpoint: search, iterate, count, facets, group_by.
get(id) reads the V3 by-id route because V4 has no by-id endpoints.
Source code in packages/aireloom/src/aireloom/_async/resources.py
219 220 221 222 223 224 225 226 227 | |
aireloom.PersonsResource
Bases: GraphResource[Person]
V4 persons endpoint: search, iterate, count, facets, group_by.
get(id) reads the V3 by-id route because V4 has no by-id endpoints.
Batch lookups by ORCID use an OR expression over ids.original.
Source code in packages/aireloom/src/aireloom/_async/resources.py
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 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
batch_get_by_orcid(orcids, *, batch_size=None, concurrency=4)
async
Fetch person records for many ORCID iDs in bounded, concurrent chunks.
Accepts any spelling bibliofabric.ids.normalize_orcid handles. Keys
are hyphenated ORCID iDs; ORCIDs without a person record are absent from
the result. The request goes out as filter=ids.original:a|b|c.
Source code in packages/aireloom/src/aireloom/_async/resources.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
aireloom.LinksResource
Bases: ResourceClient[Relation]
/v3/research-products/links: relations between research products.
This route has no cursor and no sort parameter. Page windows are therefore not pinned: if the result ordering changes between requests, pages can shift and relations can be skipped or duplicated. The iterator stops on an empty page or when the reported total has been fetched, which bounds the walk but cannot remove that upstream hazard.
Source code in packages/aireloom/src/aireloom/_async/resources.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
get_relations_info()
async
Return the relation types the links endpoint can produce.
Source code in packages/aireloom/src/aireloom/_async/resources.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
aireloom.ScholixResource
Scholix link search over the Scholexplorer host (V3 default, V2 fallback).
Backed by a dedicated internal API client for api.scholexplorer.openaire.eu
that shares the Graph client's credentials and settings but throttles
itself to one request per second (the host sends no rate-limit headers).
V3 is the default surface. Queries carrying linkProvider are routed to
V2 because V3 silently ignores linkProvider. Queries carrying
from_date or to_date raise :class:ConfigurationError because V3
returns zero rows for date filters and V2 silently ignores date parameters.
Source code in packages/aireloom/src/aireloom/_async/resources.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 | |
get_kpi()
async
Return the Scholexplorer Prometheus KPI document.
Source code in packages/aireloom/src/aireloom/_async/resources.py
707 708 709 710 | |
iterate_links(filters=None, *, page_size=None, limit=None, on_error='raise', failures=None, on_page=None)
Iterate over all matching links, 99 per page.
See :meth:search_links for V2/V3 routing rules and date-filter
rejection. The route has no cursor, so page windows are not pinned; the
iterator stops on an empty page or when the reported total has been
fetched.
Source code in packages/aireloom/src/aireloom/_async/resources.py
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | |
iterate_links_v2(filters=None, *, page_size=None, limit=None, on_error='raise', failures=None, on_page=None)
Iterate over all matching links from the V2 endpoint.
Passing from_date or to_date raises :class:ConfigurationError
because V2 silently ignores date parameters.
Source code in packages/aireloom/src/aireloom/_async/resources.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | |
list_link_providers(name=None)
async
List Scholexplorer link providers (V2).
Source code in packages/aireloom/src/aireloom/_async/resources.py
678 679 680 681 682 683 684 685 686 687 688 689 690 | |
list_link_publishers(*, in_target=True, name=None)
async
List publishers of source or target objects (V2).
Source code in packages/aireloom/src/aireloom/_async/resources.py
692 693 694 695 696 697 698 699 700 701 702 703 704 705 | |
search_links(filters=None, *, page=None, page_size=None)
async
Fetch one page of links as typed records.
Queries with linkProvider route to V2 (V3 silently ignores it);
everything else goes to V3. Passing from_date or to_date raises
:class:ConfigurationError.
Source code in packages/aireloom/src/aireloom/_async/resources.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
search_links_v2(filters=None, *, page=None, page_size=None)
async
Fetch one page of links from the V2 endpoint.
Passing from_date or to_date raises :class:ConfigurationError
because V2 silently ignores date parameters.
Source code in packages/aireloom/src/aireloom/_async/resources.py
638 639 640 641 642 643 644 645 646 647 648 649 650 651 | |
Sync client
The sync twins mirror the async classes above; they take the same parameters and raise the same errors. See Sync usage.
aireloom.AireloomSyncClient
Bases: SyncBaseApiClient
Client for the OpenAIRE Graph API (V4) and the Scholexplorer API.
Entity resources are available as typed attributes; single-entity lookups
go through the V3 by-id routes because V4 has none. Authentication
resolves in the constructor: set openaire_refresh_token /
refresh_token for OAuth2 refresh-token access, or set both
openaire_client_id and openaire_client_secret (settings,
AIRELOOM_OPENAIRE_CLIENT_ID / AIRELOOM_OPENAIRE_CLIENT_SECRET, or
client_id / client_secret) for OAuth2 client-credentials access
against the Keycloak token endpoint; partial client credentials raise
:class:ConfigurationError, and without credentials the client is
anonymous. An explicit auth_strategy always wins.
The Scholix resource talks to the Scholexplorer host through a second internal client that shares settings and credentials but throttles itself to one request per second. See the package README and docs for usage examples of both the async and the sync variants.
Source code in packages/aireloom/src/aireloom/_sync/client.py
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 | |
request(method, path, *, params=None, json=None, data=None, content=None, headers=None, timeout=None, retry=None, follow_redirects=None)
Send a request through the core retry pipeline.
V4 accepts mailto for polite-pool admission (V3 rejects it), so the
configured contact address is attached to v4/ requests only.
Source code in packages/aireloom/src/aireloom/_sync/client.py
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 | |
close()
Close both the Graph and the Scholix HTTP clients.
Source code in packages/aireloom/src/aireloom/_sync/client.py
236 237 238 239 240 241 | |
Filter models
aireloom.ResearchProductsFilters
Bases: GraphFilters
V4 filters for /v4/research-products.
Value strings may carry the operators the API accepts: a leading !
negates, >/< compare on date and numeric fields such as
impact_citation_count, sequences join with | for OR within a field
(up to 50 values), and from_/to_ pairs bound ranges.
Source code in packages/aireloom/src/aireloom/filters.py
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 | |
aireloom.ProjectsFilters
Bases: GraphFilters
V4 filters for /v4/projects.
Source code in packages/aireloom/src/aireloom/filters.py
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 | |
aireloom.OrganizationsFilters
Bases: GraphFilters
V4 filters for /v4/organizations.
Source code in packages/aireloom/src/aireloom/filters.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
aireloom.DataSourcesFilters
Bases: GraphFilters
V4 filters for /v4/datasources.
Source code in packages/aireloom/src/aireloom/filters.py
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 | |
aireloom.PersonsFilters
Bases: GraphFilters
V4 filters for /v4/persons.
Source code in packages/aireloom/src/aireloom/filters.py
284 285 286 287 288 289 290 291 | |
aireloom.LinksFilters
Bases: BaseModel
Query parameters for the Graph /v3/research-products/links route.
This route takes individual parameters (not the V4 filter expression), so each attribute maps to one query parameter.
Source code in packages/aireloom/src/aireloom/filters.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
aireloom.ScholixFilters
Bases: BaseModel
Query parameters for the Scholexplorer Links endpoints (V3 and V2).
One of sourcePid, targetPid, sourcePublisher,
targetPublisher, sourceType, or targetType is required.
linkProvider is supported on V2 only (V3 silently ignores it), so
queries carrying linkProvider are routed to V2 automatically.
from_date/to_date are rejected by :class:ScholixResource with
:class:ConfigurationError because V3 returns zero rows for them and V2
silently ignores them (see docs/aireloom/quirks.md).
Source code in packages/aireloom/src/aireloom/filters.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
Paging
iterate() yields Page records. The model is documented in the bibliofabric paging reference.
Models
aireloom.ResearchProduct
Bases: BaseEntity
Model representing an OpenAIRE Research Product entity.
Covers the V3/V4 response surface (47 keys observed live): titles, authors,
access rights, countries, subjects, indicators, instances, Open Access
flags, subtype-specific fields, and typed relationship lists. Inherits
id from BaseEntity.
Source code in packages/aireloom/src/aireloom/models/research_product.py
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | |
aireloom.Project
Bases: BaseEntity
Model representing an OpenAIRE Project entity.
Captures identifiers, title, funding, duration, and related metadata.
Inherits the id field from BaseEntity.
Source code in packages/aireloom/src/aireloom/models/project.py
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 | |
aireloom.Organization
Bases: BaseEntity
Model representing an OpenAIRE Organization entity.
Captures names, website, country, persistent identifiers, funding records,
provenance, and related entity links. Inherits the id field from
BaseEntity.
Source code in packages/aireloom/src/aireloom/models/organization.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 66 67 68 | |
aireloom.DataSource
Bases: BaseEntity
Model representing an OpenAIRE Data Source entity.
A data source in OpenAIRE can be a repository, journal, aggregator, etc.
Inherits the id field from BaseEntity.
Source code in packages/aireloom/src/aireloom/models/data_source.py
21 22 23 24 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 | |
aireloom.Person
Bases: BaseEntity
Model representing an OpenAIRE Person entity.
Captures names, identifiers (pid items are {value, typeCode,
typeLabel}, e.g. ORCID), biography, topics, measures, context, and
co-authors. Inherits the id field from BaseEntity.
Reference: https://graph.openaire.eu/docs/api/entities/person
Source code in packages/aireloom/src/aireloom/models/person.py
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 | |
aireloom.Relation
Bases: BaseModel
A single relation link between two scholarly entities.
Source code in packages/aireloom/src/aireloom/models/relation.py
50 51 52 53 54 55 56 57 58 | |
aireloom.ScholixRelationship
Bases: BaseModel
A single Scholix relationship link between two scholarly entities.
Source code in packages/aireloom/src/aireloom/models/scholix.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |