Skip to content

bibliofabric.issn: Python client for the ISSN Portal (async and sync)

The Issn client (bibliofabric.issn) is a Python client for the ISSN Portal. It reads ISSN and ISSN-L records as JSON-LD, wraps the free search over the Portal's HTML result page, and reads the list of Title Word Abbreviations. It ships an async client and a generated sync twin with the same API. All wrapped routes are free and need no credentials.

Install

uv add bibliofabric

Requires Python 3.12 or newer.

The Issn client ships in bibliofabric 0.9.0 and newer.

Quick start

import asyncio
from bibliofabric.issn import IssnClient


async def main():
    async with IssnClient() as client:
        record = await client.records.get("0028-0836")
        print(record.title, record.format)  # Nature. medium:Print

        cluster = await client.issn_l.get("0028-0836")
        print([(p.identifier, p.format) for p in cluster.has_part])

        page = await client.search.page("0028-0836")
        print(page.total, [hit.title for hit in page.hits])

        entry = await client.ltwa.page(search="journal")
        print(entry.entries[0])


asyncio.run(main())

The client sends Accept: application/ld+json on every request. Record models keep unknown keys, and record.raw holds the untouched JSON-LD node when the Portal publishes a field the model does not know yet.

Sync usage

The generated sync twin has the same API and works without an event loop.

from bibliofabric.issn import IssnSyncClient

with IssnSyncClient() as client:
    record = client.records.get("0028-0836")
    for hit in client.search.iterate("nature", limit=20):
        print(hit.issn, hit.title)

Settings

Settings come from environment variables prefixed with ISSN_ or a .env file. There is no credential field; the SRU Search API and OAI-PMH need a paid subscription and are not wrapped.

Field Default Meaning
timeout 30.0 Request timeout in seconds
max_retries 3 Automatic retries for idempotent requests
max_requests_per_second 1.0 Courtesy pace; the Portal publishes no limit
max_concurrency 2 Parallel request bound
user_agent, mailto None Contact information for the User-Agent

Package pages

Examples

Runnable scripts live in packages/bibliofabric/examples/issn: a quickstart, an ISSN-L resolution walk-through, an LTWA abbreviation lookup, and a sync-client tour.