Changelog
The release notes live in packages/bibliofabric/CHANGELOG.md and are
rendered here in full. The tagged releases with their assets are on
GitHub Releases.
Changelog
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.12.0] - 2026-12-01
Breaking
- Zenodo:
ZenodoClient.oaireturns the sharedOaiPmhResource; the methods are unchanged.bibliofabric.zenodono longer exportsOaiResource,OaiSyncResource, or theOai*models. Useclient.oaiand import the models frombibliofabric.oai. - arXiv:
parse_feedtakes the rootElementthatdecode_xml(response)returns instead of the response text.
Changed
Resource.first()works on resources whose dialect haspage_size_param=None: it dropspage_sizeand reads the first record of the page at the API's natural size. Thefirst()overrides that existed only for that case are gone (hkdir, mirabel, re3data).- OpenAlex:
parent_works[].relationshipand the/linksrelationshipfield becamelink_type(upstream, 2026-12-07). The models read both field names and map old/relationships/ids to/link-types/; theparent_works.link_typeandpull_notice_works.link_typefilters replaceparent_works.relationship. Docs and docstrings use the new part-of valuessubworkandcomponent, which replacedvolumeandpartin the same release; values still pass through unchanged.
Added
Resource.search_method: set it to"POST"to sendsearch(),count(),iterate(), andbatch_get()chunks as JSON bodies instead of query strings. The body comes from the new_build_search_body(params)hook, which receives exactly what a GET search would send as the query string and returns it unchanged by default.Resource._next_cursor(response, body):search()and cursor-modeiterate()read the next cursor through it, so a resource can page through a response header instead of the body.parse_link_header(value), exported frombibliofabric: reads an RFC 5988Linkheader into a mapping ofreltoken to URL.Noneor an unparsable value returns an empty dict.send_sparql(client, endpoint, query, ...)andrun_sparql(client, endpoint, query, ...)inbibliofabric._async.sparqland its generated_synctwin: the shared sender for SPARQL endpoints. The Wikidata SPARQL resource and the OpenCitationssparql()methods are built on them with unchanged wire behavior.decode_xml(response), exported frombibliofabric: parses an XML body into anElementand raisesAPIError, with the body quoted and the response attached, when the body is not well-formed XML.- A shared OAI-PMH 2.0 harvester:
bibliofabric.oaiholds theOai*answer models, andOaiPmhResourceinbibliofabric._async.oai(sync twinOaiPmhSyncResource) serves the six verbs and the two iterators on any repository endpoint.ArxivClient.oaimounts it onhttps://oaipmh.arxiv.org/oaithrough a second client for that host, which shares the settings and the rate budget of the query client. - ClinicalTrials.gov client (
bibliofabric.clinicaltrials): study search, get, batch, and CSV download; data model metadata, search areas, enums; the/statsroutes; andversion(), with typed study models derived from the upstream OpenAPI document. bibliofabric.inspirehep: typed async and sync client for the INSPIRE-HEP API, covering nine collections, identifier routes (DOI, arXiv, ORCID), citation formats, and citing records.- HAL client (
bibliofabric.hal): document search over/search/with offset andcursorMarkpaging, document lookups by docid, HAL identifier, DOI, or record URL, portal- and collection-scoped searches, and the structures, journals, authors, domains, instances, ANR and European projects, metadata, and document type referentials. The client needs no credentials and defaults to 3 requests per second. bibliofabric.dblp: a DBLP client with publication, person, and venue search, prefix completions in the page metadata, and full record pages by DBLP key.- GLEIF client
bibliofabric.gleif: LEI records with the relationship, ISIN, and field-modification routes, the autocompletion endpoints, the registry code lists, andexport_lei_records()for CSV, XLSX, and JSON export, with thenormalize_lei()andis_lei()helpers ofbibliofabric.idsnormalizing and checking the identifier. - Dryad client (
bibliofabric.dryad): dataset search, records, versions, files, digest lookup, reports, and downloads, which need a Dryad application token. - Figshare client (
bibliofabric.figshare): articles, collections, projects, the category, license, and item type vocabularies, and file downloads, with optional token auth for private records. - NIH RePORTER client (
bibliofabric.nihreporter): project and publication searches with criteria nesting, field selection, offset paging, and batch reads by application id on projects and by PMID or core project number on publications. - Dataverse client (
bibliofabric.dataverse): the search API (repeatingtype/subtree/fq,sort/order), collections (contents, facets), datasets with versions, files, typed metadata blocks and raw exports, streaming downloads withformat=original, metadata block definitions, server info, and the metrics routes;DATAVERSE_settings and the optionalDATAVERSE_API_KEYsent asX-Dataverse-key. Write routes are out of scope. - Software Heritage client (
bibliofabric.softwareheritage): origins, snapshots, revisions, releases, directories, contents, known, resolve, raw, extid, provenance, metadata, vault, saves, forges, and stats resources for the archive.softwareheritage.org API, with a generated sync twin, docs, tests, and examples. - ChemRxiv client (
bibliofabric.chemrxiv):ChemRxivClientandChemRxivSyncClientwithitems(search, filters, sort tokens, get, DOI lookup),categories,subjects,licenses, and OAI-PMH on/oai. The chemrxiv.org API retired on 2026-01-21; the client follows the final published spec 0.0.102 and the examples point at a live Cambridge Open Engage instance through thebase_urloverride. - Open Policy Finder client (
bibliofabric.openpolicyfinder): the Jisc Open Policy Finder API, with funders, funder groups, publishers, publisher policies, journals, and the OpenDOAR repository directory as therepositoryitem type. Typed filter models serialize into the JSONfilterparameter;limit/offsetpaging withsearch_afterfor pages past the 10000-record offset window; the CSV/object_idsdirectory parses intoObjectIdEntryrecords. Every route needs an API key (OPENPOLICYFINDER_API_KEY, sent asx-api-key). bibliofabric.osfpreprints: OSF API v2 client for preprints (search, filters, files, citations, versions, contributors, subjects, identifiers, institutions) and preprint providers (list, preprints, licenses, citation styles, subjects, taxonomies, moderators, subscriptions, withdraw requests).- Gateway to Research client (
bibliofabric.ukrigtr) for the UKRI GTR-2 API: project, person, organisation, and fund search and records, per-entity sub-routes, the merged outcomes stream plus 13 typed outcome resources with project-scoped variants, and the configs and examples metadata routes.batch_getis disabled (upstream ignores id filters) and the merged outcomes route supports noiterate()/collect()(upstream repeats records across pages); both raiseConfigurationError. bibliofabric.core: client for the CORE API v3 (works, outputs, journals, and data providers, with the shared GET and POST search routes, aggregates, per-record stats, full text downloads, raw XML records, TEI XML, discovery, and recommendations). Built and tested against the published OpenAPI document; no live check ran.- RAiD client:
bibliofabric.raidtalks to the RAiD Federation API (RaidClient/RaidSyncClient, prefixRAID_). It searches the federated open-access RAiD dataset (q, one identifier filter,updatedSince/createdSincesync windows, cursor paging), fetches single RAiDs by handle, lists the RAiDs of one service point prefix, and reads the service point directory.normalize_raid()andis_raid()inbibliofabric.idsnormalize and check RAiD handle paths. bibliofabric.nsfawards: client for the NSF Award Search APIs, with award search and filters, award records by id, project outcomes, search facets, the v2 lookup vocabularies, and the fiscal-year export files with theiter_export_awardsreader.- Mir@bel client (
bibliofabric.mirabel): title search over/titreswith fixed 1000-record offset windows, title and journal-history detail with transparent merged-id redirects, publishers by id and IdRef, online-access lists by journal or title, the subject taxonomy and its per-journal and per-grappe routes, and the partner-scoped/mes/routes (unverified, needs a partner key). No credentials are needed for the public routes; the client defaults to 1 request per second. - MeSH client (
bibliofabric.mesh): descriptor, entry term, and descriptor-qualifier pair lookups with exact, contains, and startswith matching, allowed qualifiers and descriptor details, the queryable years and per-resource label lookups, JSON-LD records by id, and the SPARQL endpoint with typed SELECT and ASK answers, raw multi-format queries, and offset-paged row iteration. bibliofabric.lobidgndwithLobidGndClient,LobidGndSyncClient,LobidGndSettings, theauthoritiesresource (search, offset iteration, record lookup,gndIdentifierbatching, autocomplete suggestions, JSONL bulk download) and thereconcileresource (service manifest and Reconciliation Specification 0.2 queries).bibliofabric.identifiersdotorg: client for the Identifiers.org resolution and registry APIs.resolve(),reverse(),similar(),namespace_usage(), anddownload_resolver_dataset()on the client; thenamespaces,resources,institutions, andlocationsregistry resources with their search routes;iter_resolver_dataset()reads the full registry snapshot (about 2 MB).bibliofabric.codemeta: pure parsers forcodemeta.json(CodeMeta JSON-LD) andCITATION.cff(Citation File Format 1.2.0).parse_codemetaandparse_cfftake a mapping, text, or bytes;parse_codemeta_fileandparse_cff_filetake a path. Every failure raisesbibliofabric.ValidationError. There is no client class: the source has no API, so the package ships no client, settings, or sync twin. Adds thepyyamldependency.bibliofabric.hkdir: a client for the DBH kanalregister API (kanalregister.hkdir.no), which serves the publication-channel tables 850 to 853 (publishers, journals, and their level per year). Reads run one DBH query per request throughsearch(),search_csv(), andget();download_csv()streams each whole table anditer_table_csv()parses it into typed records.bibliofabric.signposting: a resolver for FAIR signposting.resolve()reads the typed links of a landing page URL andresolve_doi()resolves a DOI through doi.org first. Both sendHEAD(a server that answers 405 is retried withGET), follow redirect hops themselves, parse theLinkheader into every typed link with its attributes, and follow alinksetlink into an RFC 9264 JSON orapplication/linksetdocument.bibliofabric.jufo: new client for the JUFO publication channel REST API v1.1. It covers the search route (etsi.php) through thejournals,book_publishers,conferences, andchannelsresources with lookups by ISSN, ISBN prefix, name, conference abbreviation, and type, and the single-channel route (kanava/{id}) throughchannels.get()andexists(). The API pages no results, socount()is disabled and iteration sends one request. A dump reader ships with the client:iter_dump_records()streams the nightlymassa.json.zipfull corpus, a local path or an open binary file object, as validatedChannelrecords.bibliofabric.pubmed: a client for the NCBI E-utilities, the programmatic interface of PubMed.client.idswrapsesearch.fcgi(offset paging,usehistorysupport),client.summarieswrapsesummary.fcgi(by id and composed history searches),client.recordswrapsefetch.fcgi(PubmedArticleSet XML parsed into typedPubmedArticlemodels),client.linkswrapselink.fcgi(neighbor and provider links), andclient.infowrapseinfo.fcgi. OptionalPUBMED_API_KEYrides requests throughQueryParameterAuth;toolandemailcontact parameters are configurable. The keyless default pace is the documented 3 requests per second.- re3data:
Re3dataClientandRe3dataSyncClientfor the re3data API v40 (Metadata Schema 4.0): filtered repository search (queryplus thecountries,subjects, andtypesarray filters, and rawparamsfor the rest), and full repository descriptions by re3data id. Two requests per second by default; no credentials. - VIAF client:
bibliofabric.viaflooks up authority clusters by id, LCCN, or source-local id (client.clusters.get,by_lccn,by_source_id), searches them with CQL in the full 10-per-page and BriefVIAF 250-per-page schemas (search,iterate,collect,first,count), reads the SRUexplainanswer (client.clusters.explain), and queries AutoSuggest (client.suggest.clusters). The parsersparse_cluster,parse_search_response, andparse_explainand thecql()helper are exported.ViafSyncClientis the generated sync twin. - NASA ADS client:
bibliofabric.nasadssearches the ADS Solr index (client.records.search/iterate/count/get), queries up to 2,000 bibcodes per request (client.records.bigquery), tokenizes queries (client.tokens.parse), and exports BibTeX, AASTeX, RIS, CSL, custom, and XML formats (client.exports). Every route needs an ADS token (NASADS_API_TOKEN). Built from the published API documentation; no live API check ran. bibliofabric.base, a client for the BASE HTTP interface: SOLR query search with facets, field projection, and offset paging (hitsat most 125,offsetat most 999), record lookup bydcdocid, and the repository directory with per-repository profiles. Access needs a whitelisted IP or an apikey (BASE_API_KEY); the default pace is the documented one request per second.
Fixed
- Core: errors raised while following redirects or downloading carry the
request that failed instead of the original one; redirect responses
close their streams;
HEADredirects drop the body headers;decode_xmlnames an empty body as the problem and parses bytes when the response declares no charset. - Core:
parse_link_headerlower-casesreltokens and splits quoted, escaped link entries; RAiD and LEI normalization accepts the handle.net,raid:, and single-record spellings; OAuth2 token invalidation is locked against a racing refresh;resolve_settingsrevalidates the merged settings, so field validators run on the updated values. - OAI-PMH:
harvest()takes alimit, validated like the other limits. - codemeta: pyyaml moved from the runtime dependencies to a new
bibliofabric[codemeta]extra; the CFF and codemeta parsers raiseConfigurationErrornaming the extra when pyyaml is missing andValidationErrorfor files that are not UTF-8. - Thirty-one clients got the same review pass. NASA ADS
get()quotes the bibcode query and caps the page at one record, and its batch routes reject a bare bibcode string; GLEIF routes guard negative limits and tolerate a nullmeta. The rest of the touched clients correct request shapes, page caps, and parsing, each fix with a regression test in its suite.
[0.11.0] - 2026-11-30
Breaking
OpenAlexClientandCrossrefClientexpose the rate-limit headers of the last response as the public read-only propertylast_rate_limit_headers. The private_last_rate_limit_headersname is gone.- The module-level
get_settings()function is removed from every clientconfig.py. Build settings with the<Source>Settingsclass. walk_pagesinbibliofabric._async.resourcesis private (_walk_pages).
Added
- Europe PMC
client.grantshascount(),first(), andcollect(). - ORCID
SolrResultdeclaresorcid_id,given_names, andfamily_names.
Fixed
- Wikidata
entities.iterate_ids()raisesNotFoundErrorfor an id that a successful response leaves out, as its docstring says. Withon_error="skip"the id is recorded infailures. Before, the id was dropped without a trace. WikidataSettingssetsuniform_pace_clears_rate_limits, so an overallmax_requests_per_secondalso replaces the separate SPARQL pace, as in the ROR, Zenodo, Crossref, and OpenAlex settings.- ISSN
records.count()raisesConfigurationErrorwhen the search page carries no total, like every othercount(). It returned 0. - Europe PMC
articles.get()andpreprints.get()raiseNotFoundErrorwhen the API answers an unknown id with HTTP 200 and an error list, andexists()returnsFalsefor it. Before,get()raisedValidationError. - Europe PMC
preprints.references(),preprints.citations(), andpreprints.full_text_xml()raiseConfigurationErrorbefore any request, because the API answers 404 or 500 for preprint ids. - Several docs pages called methods or passed parameters that do not
exist: Wikidata
suggestions(properties=)isproperty_ids=, the rxiv method table now matchesby_doi(),search(),first(), andcount(), and the ROR dumps listing isreleases().tests/test_docs_drift.pynow checks everyclient.<resource>.<method>()call in the client docs against the real signatures.
Removed
- The docs site no longer publishes the two internal review documents;
they moved to
archive/reviews/. The client pages state upstream behavior without the dates of individual test runs.
Changed
- The sync copies of the tests are no longer committed. The repository
conftest.pygenerates them before every pytest run, andscripts/unasync.py --checkcompares only the twins undersrc/. - The live API test suite is removed. The example scripts under
packages/bibliofabric/examples/are the live checks. - The thirteen per-client settings test files are replaced by one
parametrized module,
packages/bibliofabric/tests/test_settings_matrix.py. Handwritten tests that differed only in a literal value are now one parametrized test with a row per literal, and tests that repeated every assertion of another test are removed.
[0.10.0] - 2026-11-29
This release redesigns the public API in one step. Code written for 0.9 needs changes; the list below names every rename. No old name is kept as an alias.
Breaking
Core:
ResourceClientisResource. Sync twins addSyncbefore the kind word:BaseApiSyncClient,SyncResource,WorksSyncResource,OpenAlexSyncClient.- Every resource class is named
<Concept>Resource(WorksResource,RecordsResource), without a source prefix. Client-specific resource bases are no longer exported. - Hook and helper methods are private:
_build_filter_params,_format_sort,_build_batch_params,_default_params,_search_path,_normalize_id,_record_keys,_item_pathon resources, and_rate_class,_on_response,_is_retryable,_parse_json,_default_headers,_unwrapperon clients. - Client packages no longer re-export the core exceptions,
Page,get_settings, unwrappers, dialect objects, or internal constants. Import exceptions andPagefrombibliofabric. failureslists holdValidationErrorinstances (with.raw) instead of(dict, Exception)tuples.count()raisesConfigurationErrorwhen the API reports no total.search()raises whenpage_sizeis unsupported or whenpageandcursorare both given.batch_get()caps each chunk at the resource'sbatch_size;concurrency=Noneuses the client's limiter bound.QueryDialectparameter names default toNone.filters_modelis gone. Settings objects are frozen, andget_settings()no longer caches.unsupported_operation()stubs are typedNoReturn.strip_url_prefixis no longer exported frombibliofabric.
Parameters and return types in every client:
- No resource attribute is named
search. Search lives on the resource whose records it finds: Europe PMCclient.articles.search(), ORCIDclient.records.search()andclient.records.expanded_search(), Wikidataclient.entities.search(),client.items.search()andclient.properties.search(), ISSNclient.records.search(). - The field projection is
selecteverywhere (wasfieldsorprops), rows per page arepage_size(waslimitorrows), a row offset isoffset(wasstart), and sorting takes onesortvalue such as"submitted_date:desc"(wassort_by/sort_order,sort_field, ororder). - Parameters no longer use builtin names:
typebecameentity_type,annotation_type, orvalue_type;formatbecameoutput_format;filterbecamefiltersorfilter_query;setbecameoai_set;propertybecameproperty_id. - Methods that return one page return
Page: ISSN search and LTWA, Europe PMC grants and annotations, Semantic Scholar patent citations, and the REST search routes of Wikidata. - Models use snake_case fields with the wire names as aliases (OpenAIRE,
Semantic Scholar, DOI, Wikidata, Europe PMC). Convenience values are plain
properties and no longer appear in
model_dump().
Per client:
- OpenAlex:
search_scoped(text)issearch_scoped(query),sample(n)issample(sample_size),group_by(group_by)isgroup_by(field), andbatch_get_by_openalex_id()is removed (usebatch_get(ids)). - OpenAIRE: the
authparameter is removed (useauth_strategy=).get_fields()is removed (usebatch_get(ids, select=[...])).research_products.search_links()anditerate_links()arerelations()anditerate_relations();get_relations_info()isrelation_types(). Scholixsearch_links()anditerate_links()aresearch()anditerate(), the_v2variants are removed, andget_kpi()iskpi().group_by()is removed (usefacets()). - Crossref:
CrossRefDateandCrossRefTypeareCrossrefDateandCrossrefType.ScopedWorksResourceis removed;works()on journals, members, types, and prefixes returns aWorksResource.facets(facets=...)isfacets(fields=...)andsample(n)issample(sample_size). Pool selection lives inCrossrefSettings.pool. - ROR:
dumps.list()isdumps.releases().find_by_external_id()andfind_by_funder_doi()areby_external_id()andby_funder_doi().OrganizationFiltersfields lose the doubled words (country_country_codeiscountry_code). - Zenodo:
ZenodoRecordsClientandZenodoCommunitiesClientareRecordsResourceandCommunitiesResource.ZenodoFiles.keysisfilenames.export(id, format)isexport(id, output_format=). The OAI methods takeoai_set=, andmetadata_prefixdefaults tooai_dc.OaiErroris removed. - DataCite:
dois()on clients, providers, repositories, and prefixes takes the explicit search keywords instead of**kwargs. - OpenCitations:
meta.author()andmeta.editor()areby_author()andby_editor().SparqlTermisSparqlBindingValue, frombibliofabric.sparql. - DOI:
handle(type=)ishandle(value_type=).AgencyAnswer.RAisagency,AgencyAnswer.DOIisdoi, andHandleRecord.responseCodeisresponse_code. - Semantic Scholar:
papers.batch()andauthors.batch()are removed;batch_get()uses the POST batch routes.datasets.latest()is removed (userelease("latest")).papers.iterate()walks the bulk route by default (via="search"keeps the relevance search).PatentCitationsis removed. - ORCID:
client.recordisclient.records;client.searchandclient.expanded_searchare removed (see above), andcsv()takesselect=,page_size=, andoffset=.NormalizationErrorisNormalizationFailure. Thetext()helper is removed. Single-item readers return typed models instead of dicts. - Europe PMC: the
SearchResultmodel isArticle.client.searchis merged intoclient.articles, andfields()there isindex_terms(). Y/N flags arebool.AnnotationPageis removed. - Wikidata:
client.searchis removed (see above).WikidataQueryClientis private. - DOAJ:
get_by_id()is removed;get()accepts an ISSN, a DOI, a DOAJ id, or a doaj.org URL. - ISSN:
client.search.page()isclient.records.search(), andltwa.page()isltwa.search().SearchPageandLtwaPageare removed. - arXiv:
search(start=)issearch(offset=).ArxivEntry.versionisversion_number, andpublishedandupdatedaredatetime. The constants carry theARXIV_prefix. - bioRxiv and medRxiv:
details.get()andpublished.get()areby_doi().published.biorxiv()andby_publisher()aresearch_biorxiv()andsearch_by_publisher().serveris a keyword that defaults tobiorxiv. Dates aredatetime.date, and statistic years areint.
Added
- Every client constructor takes
mailto=, and the clients with credentials take them as keywords:ZenodoClient(api_token=),SemanticScholarClient(api_key=), andOrcidClient(access_token=, client_id=, client_secret=).CrossrefClienttakeshttp_client=. Pageiterates over its records and supportslen(); itstotal,next_cursor, andpagefields have defaults.- New core modules:
bibliofabric.concurrency(Limiter,run_bounded,maybe_await),bibliofabric.filters(serialize_filter_paramsand the filter type aliases), andbibliofabric.sparql(SPARQL result models).SafeInt,NullUnwrapper, andTokenAuthMethodare exported frombibliofabric. batch_get(params=...), andexists()falls back toGETwhen the API answersHEADwith 405 or 501.- Every disabled method names the call that works, for example
Use client.articles.search(query=...) instead. - More id forms: Europe PMC and PubMed URLs,
PPRpreprint ids, semanticscholar.org URLs, bioRxiv content URLs, doaj.org URLs, and the printedISSN 2049-3630form. - New methods: rxiv and ISSN
first()andcount(), arXivexists(), Zenodo vocabularycollect(),first(), andcount(), Europe PMCpreprints.get()andexists(), and DOAJArticle.year,Article.abstract, andArticle.journal_title. - Examples:
sync_quickstart.pyfor Crossref and ROR.
Fixed
batch_get()raisesConfigurationErroron a resource without a batch route, and when given a bare string instead of a list of ids.- Unsupported methods on OpenAlex and OpenAIRE
links, DataCitebatch_get(), and RORsearch(query=, advanced=)raise before any request. Zenodoexport()rejects an unknown format before the request. - DOAJ
iterate()stops at the 1,000-record cap with a warning instead of raising. - Wikidata entities no longer leak a redirect marker into
model_extra. - Semantic Scholar patent search sends
/patent/search. - The default filter serialization joins list values with commas instead of sending their Python repr.
[0.9.1] - 2026-11-29
Changed
- The package README and the documentation site are reorganized around using the clients. The site has one Crossref quick start, a guide for setup, settings, paging, search, identifiers, errors, and combining clients, and a quick start for each client. The guide and client pages name only methods, fields, and settings that exist in the package.
Fixed
- Releases carry provenance again. The publish job signs a PEP 740
attestation for each file with
pypa/gh-action-pypi-publish; 0.7.0 to 0.9.0 were uploaded withuv publish, which only uploads attestations that already exist. - Crossref client:
works.batch_get()filters bydoiby default. Crossref has noidfilter for works, so the inherited default made every batch fail with HTTP 400. - Crossref client:
batch_get()onjournals,funders,members,types,prefixes, andlicensesraisesConfigurationErrorbefore any request. Crossref has noidfilter on those routes, so the inherited default made every batch fail with HTTP 400 or 404. The works resources, including the scoped ones such asjournals.works(issn), keepbatch_get(). - OpenAlex client:
Award.lead_investigator.affiliation.idsis a list ofInvestigatorAffiliationIdmodels. Some awards send a list there, and the oldstrannotation madeawards.search()raiseValidationErroron them. - Europe PMC client:
articles.supplementary_files()sendsAccept: application/zip. The route answers HTTP 406 to theapplication/octet-streamheader the method used to send, so every call raisedAPIError.
[0.9.0] - 2026-11-29
Breaking
bibliofabricis one distribution. The packagesaireloom,aletheca, andstavrophoraare discontinued; their clients ship insidebibliofabricasbibliofabric.openaire,bibliofabric.openalex, andbibliofabric.crossref. The migration guide lists every rename.- Client classes carry the name of their source.
AireloomClient,AireloomSettings, andAireloomSyncClientbecomeOpenAireClient,OpenAireSettings, andOpenAireSyncClient;Aletheca*becomesOpenAlex*;Stavrophora*becomesCrossref*. Environment prefixes follow:AIRELOOM_becomesOPENAIRE_,ALETHECA_becomesOPENALEX_, andSTAVROPHORA_becomesCROSSREF_. OpenAireSettingsrenamesopenaire_client_id,openaire_client_secret, andopenaire_refresh_tokentoclient_id,client_secret, andrefresh_token; the environment names becomeOPENAIRE_CLIENT_ID,OPENAIRE_CLIENT_SECRET, andOPENAIRE_REFRESH_TOKEN.OpenAlexSettingsreads the key fromapi_keyandOPENALEX_API_KEYonly. Theopenalex_api_keyconstructor alias and theALETHECA_OPENALEX_API_KEYenvironment name are removed.- Only
bibliofabric.__version__exists; client subpackages export no__version__. - The default user agent names the client subpackage
(
bibliofabric.openalex/0.9.0) instead of the discontinued package.
Added
- Sixteen client subpackages, each with an async client and a generated sync
twin:
bibliofabric.openalex(OpenAlex),bibliofabric.openaire(OpenAIRE Graph and Scholexplorer),bibliofabric.crossref(Crossref REST and the beta Data Citation API),bibliofabric.ror(ROR),bibliofabric.zenodo(Zenodo and OAI-PMH),bibliofabric.datacite(DataCite REST and GraphQL),bibliofabric.opencitations(OpenCitations Index and Meta),bibliofabric.doi(DOI registration agencies, content negotiation, Handles),bibliofabric.semanticscholar(Semantic Scholar),bibliofabric.orcid(ORCID public API),bibliofabric.europepmc(Europe PMC),bibliofabric.wikidata(Wikidata),bibliofabric.doaj(DOAJ),bibliofabric.issn(ISSN Portal),bibliofabric.arxiv(arXiv), andbibliofabric.rxiv(bioRxiv and medRxiv). Thirteen of them were never released as separate packages. - Runnable example scripts for every client under
packages/bibliofabric/examples/<client>/, each with a README; every client's docs index links its folder. - OpenAire client:
research_products.get()accepts a DOI (bare or as a resolver URL) andpersons.get()accepts an ORCID iD. Both resolve through theidsfilters and raiseNotFoundErrorwhen nothing matches; internal OpenAIRE ids keep the by-id route. - Crossref client (changes after
stavrophora0.5.0):client.data_citations.iterate()acceptslimit=,cursor=(the 0-based page number to resume from;Page.next_cursorholds it as a string),on_error=/failures=for skipping invalid records, andon_page(page_number, next_page)for checkpoints (async callbacks are awaited), pluscollect()andfirst()on the resource. - Crossref client:
on_response()also captures the beta route's singularx-rate-limitheader intolast_rate_limit_headers. - Crossref client:
UpdateTois exported frombibliofabric.crossrefand listed in__all__. - Crossref client:
works.batch_get_by_doi()raisesConfigurationErrorbefore any request when a DOI lacks the10.<prefix>/<suffix>shape. Crossref answers the whole batch with HTTP 400 for one malformed DOI. attached_request(response)exported frombibliofabric: returns the request that produced a response, orNonewhen the response is detached (hand-built or mocked), so callers never trip over theRuntimeErrorthat readingresponse.requestraises for detached responses.BaseApiClient.download(path, dest, *, headers=None, follow_redirects=True)(andSyncBaseApiClient.download): streams the body into a temporary file next todestand moves it overdestonly after the last chunk arrived, so a failed download leaves no partial file and parent directories are created when missing.unsupported_operation(name)forResourceClientsubclasses: assigningsearch = unsupported_operation("search")makes that inherited entry point raiseConfigurationErrornaming the class and method before any HTTP call;batch_size = 0disablesbatch_getthe same way.JsonApiUnwrapper.next_cursor()acceptslinks.nextas a JSON:API link object ({"href": "<url>"}) in addition to a URL string.- An error the unwrapper raises from a parsed body (
APIErrorfor a wrong envelope,NotFoundErrororRateLimitErrorfor an error payload answered with HTTP 200) carries the request and response of the call when it comes from aResourceClientmethod, with the auth strategy's query-parameter credentials redacted in the message.
Changed
- Crossref client (changes after
stavrophora0.5.0):data_citations.search()anddata_citations.iterate()takepage_size=instead ofrows=; the wire parameter staysrows. - Crossref client: a malformed beta data citations envelope (no
messageobject, ortotal-results/next-pagethat is neither an integer nor a digit string) raisesAPIErrorwith the request and response attached instead ofConfigurationErroror a rawValueError. - Crossref client:
Work.retractionsmatchesupdated-byentries case-insensitively, andWork.is_retractedreturnsFalsewhen areinstatemententry is dated after the newest retraction. - Crossref client:
CrossrefSettings.plus_tokenis hidden fromrepr(); the value stays readable on the attribute. - Crossref client: removed the local
SafeStrList; models usebibliofabric.SafeList[str], which behaves the same.SafeIntandIdSafeStrmoved tobibliofabric.crossref.models.base. - With
follow_redirects=True, a redirect that changes the origin (scheme, host, or port) no longer carries headers or query parameters that an auth strategy added, so credentials never cross to another host; httpx by itself strips onlyAuthorization,Cookie, andProxy-Authorization. Caller-suppliedAuthorizationandCookieheaders are still dropped on origin changes as httpx does. Redirects are followed hop by hop, up to the http client'smax_redirects, and its cookie jar still fills theCookieheader of every hop. ResourceClient.get()raisesValidationError(request and response attached) when the unwrapped item contains none of the keys the model declares, after alias resolution.search(),iterate(),collect(),first(), andbatch_get()treat such records as validation failures: raised by default, or skipped intofailureswithon_error="skip", instead of validating them into models whose every field holds its default. Models that declare no fields keep working.BaseApiClient.get_json()forwardstimeout,retry, andfollow_redirectstorequest()like every other call.ClientCredentialsAuth.invalidate_token(failed_token=None)clears the cached token only when it still holds that token;BaseApiClientpasses the rejected token on HTTP 401, so two concurrent 401s cannot drop a token another request has already replaced.normalize_arxiv()lowercases the whole id, so the version suffix normalizes too (1706.03762V1to1706.03762v1).normalize_issn()accepts ISSN Portal URLs such ashttps://portal.issn.org/resource/ISSN/2049-3630.ResourceClient.search()anditerate()raiseConfigurationErrorforpage_sizebelow 1 before any request, instead of sending it upstream.- A redirect loop under
follow_redirects=TrueraisesNetworkError(thehttpx.TooManyRedirectsis kept as__cause__) instead of leaking the httpx exception, inrequest(),get_json(),stream(), anddownload(). AuthStrategy.invalidate_token()takes afailed_tokenargument. A custom auth strategy written against the old zero-argument signature raisesTypeErroron an HTTP 401 and must add the parameter.
Fixed
- OpenAire client (fix after
aireloom0.9.1): the client imports with pydantic 2.9.0, the declared floor ofbibliofabric. The three filter type aliases are plainTypeAliasassignments again: pydantic builds a schema from atypestatement (PEP 695) only from 2.10 on, so the import failed with 2.9. - Crossref client:
client.data_citationsresolves/beta/datacitationsagainst the base URL's parent directory, so a custombase_urlpath prefix (for examplehttps://mirror.example.org/crossref/v1) is preserved instead of stripped. - Crossref client:
data_citations.iterate()validatespage_size,limit,on_error, andcursorbefore the first request, stops on an empty page, and stops whennext-pagerepeats or moves back instead of looping forever. _search_params()no longer callssearch_path(None)and no longer compares path results to decide whetherquery=is supported. It checks whether the subclass overridessearch_path, so a subclass may mapNoneor""to a wildcard and may rejectNoneitself without breaking valid queries.- Identifier normalizers strip
#fragmentand?queryparts before trailing slashes;normalize_isbn()andnormalize_isni()accept resolver URLs with trailing slashes;normalize_ror()also stripshttp://www.ror.org/andwww.ror.org/;normalize_wikidata_qid()accepts barewikidata.orghosts and theProperty:namespace (https://www.wikidata.org/wiki/Property:P31); digit checks reject Unicode digits such as²instead of raisingValueError; the undocumentedgdz:GND prefix was removed. - A
User-Agentset indefault_headersis no longer dropped in favor of the fallback User-Agent injected for a caller-ownedhttp_client. - The test fixture
FakeSettingspins every settings field explicitly, so exportingUSER_AGENT,FOLLOW_REDIRECTS, orMAX_RETRIEScannot change test behavior.
[0.8.0] - 2026-11-28
Companion client versions built on this release: aireloom 0.9.1, aletheca 0.5.1,
and stavrophora 0.5.0 (all pinning bibliofabric>=0.8,<0.9), and the eleven
Wave 1 libraries.
Added
BaseApiClient.default_headersproperty: headers sent with everyrequest()andstream()call, overridden per call byheaders=.follow_redirects: bool | None = NoneonBaseApiClient.request()andBaseApiClient.stream(), overridingBaseApiSettings.follow_redirectsfor one call (for example to read theLocationheader of a DOI resolver's 3xx response, or to follow content-negotiation redirects).ResourceClient.default_params()hook: query parameters sent with every list,count(), and batch request.ResourceClient.search_path(query)hook: the list route for search,count(), and batch requests, for APIs that carry the query in the path.query=is accepted when the dialect has noquery_paramas long as the search path uses the query.JsonApiUnwrapperinbibliofabric.unwrap: reads JSON:API envelopes (data,meta.total, and the cursor query parameter inlinks.next).- Identifier normalizers
normalize_isbn(ISBN-10 to ISBN-13),normalize_isni,normalize_arxiv,normalize_pmid,normalize_pmcid,normalize_wikidata_qid,normalize_gnd, andnormalize_viaf.
Changed
normalize_roralso strips theror.org/andhttps://www.ror.org/prefixes.
[0.7.0] - 2026-11-27
Companion client versions built on this release: aireloom 0.9.0, aletheca 0.5.0,
and stavrophora 0.4.0 (all pinning bibliofabric>=0.7,<0.8).
Added
on_error("raise"/"skip") andfailurescollector onResourceClient.search(),batch_get(),iterate(),collect(), andfirst()(#16).- Concise, sanitized upstream HTTP error body summaries in
APIErrorandAuthError__str__, plusAPIError.status_codeandRateLimitError.retry_after(#18). validate_model()helper exported frombibliofabric(wrappingpydantic.ValidationErrorintobibliofabric.ValidationErrorwith the offending payload attached) andparse_json()guarding 2xx JSON decoding.select=andparams=passthrough onResourceClient.get()andid: str | intidentifier widening on resource lookups (get(),exists(),item_path()).QueryDialect.count_page_sizeto control the page size used bycount().- Idempotent-by-default retry policy (
GET,HEAD,OPTIONS,PUT,DELETE) with per-callretry: bool | None = Noneoverride onBaseApiClient.request()(enabling retries on read-onlyPOSTbatch calls withretry=Trueor disabling retries withretry=False). BaseApiSettings.follow_redirects(defaultFalse) andBaseApiSettings.connect_timeout(defaultNone), plus automatichttpx.Limitssizing (max_connections=max(20, max_concurrency * 2),max_keepalive_connections=max(10, max_concurrency)) for ownedhttpxclients.BasicAuth(username, password)andRefreshTokenAuth(token_url, refresh_token, ...)auth strategies (exported frombibliofabricandbibliofabric.auth).ClientCredentialsAuthnow supportsscope,token_auth_method("basic"or"post"),timeout, caller-ownedhttp_client, andinvalidate_token().- Single-retry-on-401 token refresh in
BaseApiClient.request()andstream()when the auth strategy exposesinvalidate_token(). - Automatic custom credential redaction via
redacted_query_paramsandredacted_headerson auth strategies (QueryParameterAuth,HeaderAuth,BasicAuth,StaticTokenAuth, OAuth2 strategies), applied to debug logs and exception messages. BaseApiClient.on_response(response)hook called after every HTTP response before status errors raise.BaseApiClient.stream(method, path, *, params=None, headers=None, timeout=None)context manager (async and sync) for streaming responses with auth, rate limiting,on_response, 401 refresh, and error mapping.- Overridable
ResourceClient._fetch_batch_chunk(field, chunk, *, select=None)hook soPOST-batch and path-batch clients inherit chunking, deduplication, concurrency, validation,on_error/failures, and keying frombatch_get(). - Flexible
QueryDialect:page_size_parammay beNone(unpaged APIs),max_offsetcaps page/offset depth, andResourceClient(..., dialect=...)allows per-instance dialect overrides. - Fast-path bulk validation using a lazily cached
TypeAdapter(list[E])perResourceClientsubclass on theon_error="raise"path, falling back to per-record validation on failure soValidationError.rawstill attaches the offending record. - Python 3.14 trove classifier in
pyproject.toml.
Changed
ResourceClient._search_params()(plusget(),batch_get(), anditerate()) now fail fast withConfigurationErrorwhen callers passquery,select,sort,cursor, orpageagainst aQueryDialectthat does not declare the corresponding parameter.BaseApiSettingsvalidates positive/non-negative bounds and finiteness fortimeout,max_retries,max_retry_wait,max_requests_per_second,max_concurrency, andrate_limitsentries (allowingNoneto disable pacing for a specific rate class).
Fixed
- Non-starving O(1)
Limiter: reserves rate-class slots monotonically before acquiring concurrency slots so long spacing or 429 backoff sleeps do not block sibling classes or workers. ResourceClient.first()now requestspage_size=1instead of fetching a full default page.ResourceClient.count()omits the cursor parameter for page/offset and hybrid dialects (cursor-only dialects still sendcursor_start) and honorsQueryDialect.count_page_size.- Injected
http_clientinstances now resolvebase_urlproperly and receive the configuredUser-Agentheader when not already set. ClientCredentialsAuthuses monotonic clocks for token expiry, handles missing/short expiry cleanly, and surfaces token-endpoint errors consistently.normalize_orcid()strips trailing slashes and validates digit/checksum format before hyphenating;normalize_ror()strips trailing slashes before lowercasing.
[0.6.0] - 2026-11-26
Overhaul of the public API. Versions of the client libraries after this
release: aireloom 0.8.0, aletheca 0.4.0, stavrophora 0.3.0; they pin
bibliofabric>=0.6,<0.7.
Changed
- Auth strategies implement both method pairs
(
async_authenticate/async_closeandauthenticate/close), so one strategy object works with either client variant.ClientCredentialsAuthlazily creates anhttpx.AsyncClientorhttpx.Clientper variant, guards each variant's refresh with its own lock, and shares the cached token. - The
bibliofabric.clientandbibliofabric.resourcesmodule paths are gone; importBaseApiClient,ResourceClient, andOnErrorfrom the package root. ResourceClient.batch_getbounds its chunk fetches through the sharedrun_boundedprimitive instead of a local semaphore +gather.- Search text is keyword-only (
query=), and a string passed in thefiltersposition raisesConfigurationErrornamingquery=before any request is sent. Before, a positional query was sent as thepageparameter (#12).
Breaking changes
- Replaced the four resource mixins (
GettableMixin,SearchableMixin,CursorIterableMixin,PageIterableMixin) andBaseResourceClientwith one genericResourceClient[E], configured by a frozenQueryDialect. Behavior knobs are now hook methods (build_filter_params,format_sort,build_batch_params,normalize_id,item_path) instead of_param_*class attributes. request()always returnshttpx.Responseand raises on status >= 400: 404 isNotFoundError, 429 isRateLimitError, 401/403 isAuthError, other statusesAPIError. The silent raw-dict/httpx.Responsefallbacks on validation failure are gone;get(),search(), anditerate()raiseValidationErrorcarrying the rejected payload inraw.search()returns a genericPage[E](results, total, next_cursor, page, meta) instead of an API-specific envelope or raw dict.ResponseUnwrappermethods were renamed toresults,item,total,next_cursor,meta(wasunwrap_results,unwrap_single_item,get_next_page_token,get_total_results).BaseApiSettingswas reduced to the fields the client actually reads (timeout,max_retries,max_retry_wait,max_requests_per_second,max_concurrency,user_agent,mailto). Removed caching, pacing, hook, and rate-limit-buffer settings; subclasses set their ownenv_prefix.- Removed: pre/post request hooks, response caching (
enable_caching,cache_*, cachetools), rate-limit header pacing,raw=flags,on_validation_errorhooks,expected_modelparameters,AuthStrategyType,get_base_settings(),DigMixin/safe_dig,ValidationErrorContext,BibliofabricRequestError,log_config.configure_logging(), and the loguru dependency. The library uses standardloggingand adds no handlers. batch_getmoved intoResourceClientwith signaturebatch_get(ids, field="id", batch_size=None, concurrency=4); it returns a dict keyed by normalized id and omits missing ids.- Retries are governed by an overridable
BaseApiClient.is_retryable(response)(default: 429, 500, 502, 503, 504) and honorRetry-After, capped atmax_retry_wait; the former lock-held buffer sleep and ignored Retry-After are gone.
Added
- Sync twins generated from the async source (D-17): the I/O modules moved
into the internal async package, and
scripts/unasync.pygenerates the committed sync package plus sync test modules. The package root now also exports the sync base client and resource classes (renamed in the current release); sync twins work inside a running event loop because they never touch one. - Request-class limiter (D-19):
BaseApiSettings.rate_limitsdeclares requests-per-second per class (max_requests_per_secondremains the rate of the"default"class), andBaseApiClient.rate_class(request)is the overridable hook that assigns a class per request. Each class gets its own minimum-interval gate; the concurrency bound is shared. HeaderAuth(name, value)for static credential headers (Crossref Plus).ClientCredentialsAuthsends aUser-Agenton its token client (user_agent=parameter).APIError.body: the parsed JSON error payload of error responses.bibliofabric.ids:normalize_doi,is_doi,strip_url_prefix,normalize_orcid,normalize_ror,normalize_issn.bibliofabric.paging:QueryDialectandPage[E].QueryDialect.iterate_page_size: the page sizeiterate()uses when the caller passes none.ResourceClient(client, path=...): per-instance paths for routes bound to a parent id, such asmembers/{id}/works.- Cursor iteration stops when the API returns the request cursor unchanged (Solr-style exhaustion).
SafeListnow wraps a scalar string into[value]instead of a character list.- Default
User-Agentbuilt from package metadata:<package>/<version> (+<homepage>; mailto:<mailto>). - Debug logs redact
api_key, token query parameters, and auth headers. - Tooling:
uv_buildbackend,py.typedshipped, exacttypin in thedevgroup, ruff lintingsrcandtests, Keep a Changelog file, and a CI workflow with concurrency cancellation, least-privilege permissions, and tag-triggered trusted publishing.
[0.5.2]
Fixed
- Raise
NotFoundErrorfor model-backed requests that receive a 404 response. - Redact query credentials such as
api_keyfrom request and exception logging. - Add opt-in validation-failure hooks carrying the raw response body or rejected resource record and the validation exception.
- Add
raw=Truepassthrough support toBaseApiClient.request()and resourceget()/search()calls.