Skip to main content

librarian-scholarly

A scholarly search backend for librarian's research loop. It answers librarian's science category from the official APIs of OpenAlex, Crossref, arXiv, PubMed (NCBI E-utilities), and Semantic Scholar, instead of scraping them through a metasearch.

librarian research loop ──► ScholarlyBackend ──► OpenAlex · Crossref · arXiv · PubMed · Semantic Scholar
                                  │
                 one source at a time · each paced to its limit · cached · cooldown on refusal

Why: in librarian's measurements, 4 of the 5 requests a research iteration sends to SearXNG are science pages, and the science engines are the ones that rate-limit. These APIs are free, documented, and meant for this.

Install

Install into the same environment as librarian, then route the science category to it beside your web backend:

uv pip install librarian-scholarly
# librarian's .env
RESEARCH_SEARCH_ROUTES=web: searxng; video: searxng; science: scholarly, searxng
SCHOLARLY_MAILTO=you@example.org     # optional: OpenAlex/Crossref polite pools, NCBI contact

With more than one backend installed, librarian needs RESEARCH_SEARCH_ROUTES (or RESEARCH_SEARCH_BACKEND); it refuses to guess.

Settings

Setting Default What it does
SCHOLARLY_SOURCES openalex,crossref,arxiv,pubmed (+ semanticscholar with a key) Sources asked, in this order
SCHOLARLY_MAILTO empty Contact address sent to OpenAlex, Crossref, and NCBI
OPENALEX_API_KEY empty OpenAlex key (a free key raises its daily allowance)
SEMANTIC_SCHOLAR_API_KEY empty Semantic Scholar key; the keyless pool is shared and often refuses
NCBI_API_KEY empty Raises PubMed's limit from 3 to 10 requests a second
SCHOLARLY_PER_SOURCE 25 Most results asked of one source per search
SCHOLARLY_<SOURCE>_INTERVAL arXiv 3.0, PubMed 0.4, others 1.0–1.1 Seconds between two requests to one source
SCHOLARLY_COOLDOWN_SECONDS 600 How long a refusing source is left out (doubling, unless it sends Retry-After)
SCHOLARLY_TIMEOUT_SECONDS 30 Per request

Keys are sent to their API and never written to librarian's search cache.

What it returns

Each source's results in its own relevance order, interleaved, one result per paper (by DOI, arXiv id, or title: one paper often arrives as an open copy from one API and a DOI from another), with the link most likely to be readable: an open-access copy where the API knows one (OpenAlex's best OA location, a PubMed Central article, Semantic Scholar's open PDF), else the DOI, else the API's own page. Filtering, ranking, and caps are librarian's, as for every backend.

What the APIs said on September 30, 2026

  • OpenAlex prices requests: a search cost $0.001, and the keyless allowance was $0.10 a day (its X-RateLimit-* headers say so).
  • Crossref's public pool allowed 1 request a second.
  • arXiv asks for one request every 3 seconds.
  • PubMed allowed 3 requests a second without a key.
  • Semantic Scholar refused the first keyless request (429), which is why it's on by default only with a key.

A source that refuses (429 or 503) is left out of searches for a cooldown and reported to librarian as degraded; the other sources still answer.

The services' terms

This package's license covers its code, not the services it calls. What they return is subject to each one's terms, which you accept when you use them. Semantic Scholar's API license asks you to attribute "Semantic Scholar" wherever its data appears in what you publish. arXiv's API terms ask you not to present a project as endorsed by arXiv.

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for librarian-scholarly 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librarian-scholarly 0.1.0
File Size Uploaded Provenance Actions
librarian_scholarly-0.1.0.tar.gz 16.6 kB With provenance Details for librarian_scholarly-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for librarian-scholarly 0.1.0
File Interpreter ABI Platform Actions
librarian_scholarly-0.1.0-py3-none-any.whl Python 3 none any Details for librarian_scholarly-0.1.0-py3-none-any.whl

Total release size: 32.5 kB

Release files / librarian_scholarly-0.1.0.tar.gz

Download URL librarian_scholarly-0.1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c911855da55457a8587893f2305775540307315699c3e0e0849cdd114579be88
BLAKE2b-256 checksum
How to use checksums
05782ae7367a1c9375a0021c433871c8f2ea3230345ed746d547391333aee3dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / librarian_scholarly-0.1.0-py3-none-any.whl

Download URL librarian_scholarly-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4be028860064a3a3e8102663f8a7f14d11cba01c8776b6dab3e0868597d042be
BLAKE2b-256 checksum
How to use checksums
36298d22e55b2d245008aa3810ec4eb11910c73cbeab8e2e99212f2e1d5deb93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for librarian-scholarly 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for librarian_scholarly-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page