Skip to main content

OAR — bibliometric reporting from OpenAlex

PyPI

OAR builds a bibliometric database for any set of papers: a university, a researcher, a country, a funder's portfolio or a list of DOIs. It answers the questions a research office asks of InCites. How many papers, how often they are cited relative to their field, who the institution publishes with, and how much of the output is open access.

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, and it stores the result as ids. OAR keeps those scores and adds what they leave out: titles, authors, affiliations and the open-access copy. The result is one DuckDB file. After the build, nothing calls OAM or the network, and the file can be handed to someone who does not have either installed.

A paper is scored only when it is in OAM's scope, peer-reviewed research in English, about 13% of OpenAlex. P_all counts every work in the set, of every OpenAlex type, including datasets and software. P_scored counts the ones the impact indicators use. For EPFL the two differ by about a third, and a report should say so.

Get started

Python 3.11 or newer.

pip install openalex-reporting             # query a database that already exists
pip install 'openalex-reporting[build]'    # also install OAM, which oar.build reads

Querying needs DuckDB 2.0 or newer. The install above provides it. An older DuckDB cannot open a file this package writes.

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

import oam
oam.download(edges=True)       # 12 GB plus the citation links, 9.9 GB, 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). OAR still reads one OAM data directory.

Then build. This one is EPFL. The same call works for an author, an ORCID, a country, a funder or a list of DOIs.

import oar

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

The file lands in ./data 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. Set OPENALEX_API_KEY before building. A university is a few 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.

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.

What a build stores

The file has two parts.

The entity is this selection, described by the API: title, abstract, authors, affiliations, funders, locations, and the citation count in each recent year. The publication year, the subfield and the journal-or-conference flag are taken from the OAM snapshot, not from the API. Those three are what a score was computed from. When the API disagrees, the API values are kept beside them and the work is flagged cohort_changed. The build prints how often that happens.

The world is every work's id, score and institutional affiliation, copied from OAM, about 8 GB. That is what a baseline is computed from: the world, a country, or another institution. It is ids and names, not the text of every paper. world="all" also copies authors, DOIs and ORCIDs, so a researcher can be a peer. world=None keeps only the selection, and baselines are then unavailable.

A paper in a cohort of fewer than 500 works keeps its row and its raw citation count, but its normalised score, percentile and top-10% and top-1% flags are NULL. An impact average skips those NULLs, so it does not need a reliability filter. count(ncs) is the number of scored papers.

The file stores who cited the selection, in which year, and whether the citation is a self-citation. That comes from OAM's citation links, which oam.download(edges=True) installs. The build stops when they are missing.

The build writes a markdown file next to the database, with the same stem: epfl-2026-10-14.md beside epfl-2026-10-14.duckdb. It describes every table and column, explains which papers are scored and which are not, gives queries, and records reference values taken from that file. The text is oar/doc_template.md, the same for every database; the build fills in the numbers and the table list, and oar.doc() rewrites the file after the template changes.

The full OpenAlex snapshot is not stored. It is more than a terabyte, and the baselines do not need it.

The indicators

oar.indicators() returns one row per group. counting="full" gives every paper weight 1. counting="frac" gives a paper shared with other institutions a weight of one over the number of institutions. Impact uses scored papers, the ones with a normalised score, which is OAM's rule of cohorts of at least 500, so MNCS_full matches oam.aggregate.

oar.indicators(by="publication_year")          # this selection
oar.baseline(world=True)                        # every scored paper
oar.baseline(country="CH")                      # Switzerland
oar.baseline(institution="I35440088")           # ETH Zurich
oar.partners().head(20)                         # who EPFL publishes with
oar.works().head(20)                            # one row per paper, with its scores

The same queries are stored in the file for a SQL client:

SELECT * FROM indicators_by_year();
SELECT * FROM indicators_overall();
SELECT * FROM baseline_world_by_year();
SELECT * FROM baseline_country_by_year('CH');

Indicators maps each of these columns to the InCites list they stand in for, and records the ones that are not computed. Building is the build, querying is every function, and schema is every table.

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. oar.status() prints it.

OAR is released under the MIT licence. See LICENSE.

Metadata

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

Built distribution (wheel)

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

Total release size: 98.0 kB

Release files / openalex_reporting-0.1.0.tar.gz

Download URL openalex_reporting-0.1.0.tar.gz
Size 49.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dc392853a4cb375282e61bf051e66fcc135593b191893dc4ee323ffc78e5702b
BLAKE2b-256 checksum
How to use checksums
2e26879477acbe00fa43a001fa0dc3555caa71e0ad561c53a3b0ba5314094b01
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 4, 2026.

Transparency log

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

Download URL openalex_reporting-0.1.0-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed767dd125c6a8e2050134781bd4ecbe44bbdb743778de852e955e18c8313a21
BLAKE2b-256 checksum
How to use checksums
c822f0f390421830d91940e9df8812b5d547ea07020b90df579cbf3d05b5eed1
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 4, 2026.

Transparency log

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

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

Select from 2 files

Attestation for openalex_reporting-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 Nov 4, 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