Skip to main content

OAR — bibliometric reporting from OpenAlex

PyPI

OAR builds a bibliometric database for a university. The same call works for a researcher, a country, a funder or a list of DOIs. The result is one DuckDB file and a markdown guide beside it. The guide holds the queries, each with its result on that file. Reading them needs DuckDB 2.0 or newer and nothing else.

The citation scores come from OAM. OAM compares each paper with papers of the same subfield, the same publication year and the same kind of venue, journal or conference. OAR keeps those scores and adds titles, authors, affiliations and the open-access copy.

A paper is scored only when it is in OAM's scope, peer-reviewed research in English, about 13% of OpenAlex. count(*) counts every work in the set, of every OpenAlex type, including datasets and software. count(ncs) counts the ones an impact average uses. For EPFL the two are 148,555 and 96,201, and a report should say which one it shows.

Get started

Python 3.11 or newer.

pip install 'openalex-reporting[build]'

oar.build reads an OAM dataset. Install it once, on the machine that builds the database. One call fetches both Zenodo files: the scores, 12 GB, and the citation links published beside them, 9.9 GB.

import oam
oam.download(edges=True)       # into ~/oam-data

oam.download() without edges=True skips the links, and oar.build then stops. From archives already on disk, give the folder that holds both oam-<snapshot>.tar and edges-<snapshot>.tar: oam.download("path/to/dist", edges=True).

The institution id is the number in its OpenAlex URL. https://openalex.org/I5124864 is EPFL, so the argument is I5124864. Set OPENALEX_API_KEY before building. A university is about ten thousand requests; without a key the daily limit is too low. Copy .env.example to .env to keep the key out of the shell history.

import oar

oar.build(name="epfl", institution="I5124864")

The file lands in ./output when Python imports this checkout, which it does when you run it from the repository directory, and in ~/oar-data otherwise. oar.set_data_dir(path) or the environment variable OAR_DATA_DIR puts it somewhere else. output/ is not committed.

For EPFL that is about 150,000 works, about 13,000 API requests, and a file of 8.0 GB. The build took about 30 minutes once the download had finished. A second call with the same selection does nothing if that snapshot was already built. The API responses are cached per work, so the next institution reuses the papers the two share.

The same call works for an author, an ORCID, a country, a funder or a list of DOIs. world="all" also copies authors, DOIs and ORCIDs, which a comparison against a researcher needs. A country the size of the United States is a few million API requests; build it with details=False and the counts come from the world tables alone. Building has every option.

What you get

Two files with the same stem, for example epfl-2026-10-14.duckdb and epfl-2026-10-14.md.

The database has two parts. The selection is this set of works, described by the API: title, abstract, authors, affiliations, funders, locations. The publication year, the subfield and the journal-or-conference flag come from the OAM snapshot, because those three are what a score was computed from. The world is every work's id, score and institutional affiliation, copied from OAM, about 8 GB. A comparison with another institution, a country or the world reads it. It holds ids and names. world=None keeps only the selection, and those comparisons then see only it.

The guide opens with one page for the people who will read the numbers: what the file holds, how to use it with an AI assistant, and what to say when quoting a figure. The rest describes every table and column, explains which papers are scored, and gives the queries. The text is oar/doc_template.md, the same for every database. The build fills in the numbers, runs each query and writes the first rows of its result. oar.doc(path) writes the guide again after the template changes.

An EPFL guide is a full example of that file.

A query

Scored papers, the mean normalised citation score and the top-10% share. EPFL, 2021 to 2024, from the snapshot of 14 October 2026:

SELECT w.publication_year AS year,
       count(m.ncs) AS scored,
       avg(m.ncs) AS mncs,
       100 * avg(m.is_in_top_10_percent::INT) AS pp_top10
FROM works w
LEFT JOIN work_metrics m USING (work_id)
WHERE w.publication_year BETWEEN 2021 AND 2024
GROUP BY w.publication_year
ORDER BY year;
year scored mncs pp_top10
2021 4,498 1.80 20.08
2022 4,349 1.89 20.74
2023 4,470 1.74 20.25
2024 4,457 1.83 21.11

count(ncs) is the scored papers. mncs is the mean of OAM's normalised citation score, and the world average is 1. pp_top10 is the share OAM flagged in the top 10% of their cohort. The guide has the same figures together with collaboration, open access, a peer, a country and the world.

An example

examples/epfl.py builds EPFL and prints it next to ETH Zurich and next to Switzerland.

Data and licence

The descriptive fields come from the OpenAlex API. The scores and the world tables come from OAM's snapshot, which is released under CC0. Say which snapshot you used. build_info in the file records it.

OAR is released under the MIT licence. See LICENSE.

Metadata

Release files for openalex-reporting 0.2.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 openalex-reporting 0.2.0
File Size Uploaded Provenance Actions
openalex_reporting-0.2.0.tar.gz 44.1 kB With provenance Details for openalex_reporting-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openalex-reporting 0.2.0
File Interpreter ABI Platform Actions
openalex_reporting-0.2.0-py3-none-any.whl Python 3 none any Details for openalex_reporting-0.2.0-py3-none-any.whl

Total release size: 85.4 kB

Release files / openalex_reporting-0.2.0.tar.gz

Download URL openalex_reporting-0.2.0.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ecb66675ddc015e93d318b96797dc6acc857f48923dd11faa86f299a92c2b9cb
BLAKE2b-256 checksum
How to use checksums
48b9de7d4e5b2c81c6703c63695125edef6bf2b44b778000224a4800ab911408
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / openalex_reporting-0.2.0-py3-none-any.whl

Download URL openalex_reporting-0.2.0-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04de2c16015e58ae31d1137324f0f7cbd95dc3e2046c784d5f62a449eb159921
BLAKE2b-256 checksum
How to use checksums
bdd635a5bbf3bb2df551ba2d5cb423718e3a1c1652568bc6bbf8b0322c2dc120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for openalex-reporting 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openalex_reporting-0.2.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 Nov 5, 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.2.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