Mir@bel
The Mir@bel client (bibliofabric.mirabel) reads the
Mir@bel API, the web service of the French
Mir@bel network for online access to journals. It answers titles, journal
histories, publishers, online-access declarations, the subject taxonomy, and
the partner-scoped /mes/ routes, and returns typed Pydantic models. An
async client and a generated sync twin expose the same calls. Mir@bel
publishes the data under the open licence (Licence Ouverte, Etalab:
licence-ouverte-open-licence).
Credentials
No route needs credentials to read. A partner key, set with
MIRABEL_PARTNER_KEY, unlocks the three /mes/ routes on client.mes and
adds the partner-scoped fields (urlproxy, identifiantpartenaire) to the
access routes. The client paces itself to one request per second
(Mir@bel asks for at most two); tune it with MIRABEL_MAX_REQUESTS_PER_SECOND
and MIRABEL_MAX_CONCURRENCY, as the
settings guide describes.
Quick start
import asyncio
from bibliofabric.mirabel import AccesRevueFilters, MirabelClient, TitreFilters
async def main() -> None:
async with MirabelClient() as client:
titre = await client.titres.first(TitreFilters(issn="1660-7880"))
print(titre.full_title, "-", ", ".join(titre.editeurs))
revue = await client.revues.get(titre.revueid)
print("journal", revue.id, "holds", len(revue.titres), "titles")
detail = await client.editeurs.get(64)
print(
detail.editeur.full_name,
"publishes",
len(detail.relations_titres),
"titles",
)
acces = await client.acces.by_revue(AccesRevueFilters(issn="1169-1018"))
for row in acces[:3]:
print(
"access:", row.ressource, row.contenu, row.datedebut, "-", row.datefin
)
page = await client.themes.search()
print(len(page.results), "theme nodes in the taxonomy")
asyncio.run(main())
A contrario. Revue interdisciplinaire de sciences sociales - BSN Press, Editions Antipodes
journal 444 holds 1 titles
Observatoire français des conjonctures économiques publishes 5 titles
access: Persée Intégral 2002 - 2004
access: Cairn.info Intégral 2002 - None
access: JSTOR Intégral 2002-01-01 - 2023-01-01
124 theme nodes in the taxonomy
Sync quick start
from bibliofabric.mirabel import MirabelSyncClient, TitreFilters
with MirabelSyncClient() as client:
titre = client.titres.first(TitreFilters(issn="1660-7880"))
print(titre.full_title, "-", ", ".join(titre.editeurs))
page = client.titres.search(TitreFilters(titre="monde%"))
print(len(page.results), "titles on the first window")
A contrario. Revue interdisciplinaire de sciences sociales - BSN Press, Editions Antipodes
journal 444 holds 1 titles
47 titles on the first window
The sync client uses plain httpx.Client and never touches an event loop;
see async and sync clients.
What the client offers
| Attribute | Returns | Methods | Notes |
|---|---|---|---|
client.titres |
Titre records |
get, first, search, iterate, collect, batch_get |
filter search over /titres; get(id) follows merged-id redirects |
client.revues |
Revue records |
get |
the publication history of one journal, titles included |
client.editeurs |
EditeurDetail records |
get, by_idref |
by Mir@bel id or IdRef PPN |
client.acces |
Acces records |
by_revue, by_titre |
complete, unpaged lists; at least one filter criterion required |
client.themes |
Theme records |
search, first, iterate, collect, by_revue, by_titre, by_grappe |
the whole taxonomy in one call |
client.mes |
Acces, AccesChanges, Titre |
acces, acces_changes, titres |
partner key required; written from the published spec, not verified against the live API |
Mir@bel reports no matched totals, so count() is not available on any
resource, and client.titres.search() pages in fixed windows of 1000
records through the offset parameter.
Examples
Runnable scripts live in packages/bibliofabric/examples/mirabel:
quickstart.py: a title by ISSN, a journal history, a publisher, accesses, and the taxonomy.sync_quickstart.py: the same lookups with the sync client.
Next
- Upstream quirks: what the live API does differently from its documentation.
- API reference: every public class generated from the source.