Skip to main content

oaipmh

PyPI version Python versions CI License

A Python library for working with OAI-PMH version 2 — harvest metadata from existing repositories using the client, or expose your own repository using the server. This is a maintained fork of infrae/pyoai.

Installation

Install the latest release from PyPI:

pip install oaipmh

Requires Python 3.11 or newer. Python 3.11 through 3.15 are supported.

Version 4.0.0 removes Python 3.10 support after its upstream end of life. Upgrade to Python 3.11 or newer, or remain on oaipmh 3.2.1 if you still need Python 3.10.

Quickstart

A minimal client that lists records from an OAI-PMH endpoint using the Dublin Core metadata prefix:

from oaipmh.client import Client
from oaipmh.metadata import MetadataRegistry, oai_dc_reader

URL = "http://uni.edu/ir/oaipmh"

registry = MetadataRegistry()
registry.registerReader("oai_dc", oai_dc_reader)
client = Client(URL, registry)

for record in client.listRecords(metadataPrefix="oai_dc"):
    print(record)

Migrating from pyoai

If you already depend on pyoai, migration is a dependency swap:

  • Replace pyoai with oaipmh in your requirements (pip install oaipmh).
  • Import paths are unchanged — from oaipmh import ... continues to work.
  • The minimum supported Python version is 3.11.

No application code changes are required beyond the dependency rename. See Why this fork for background.

Why this fork

oaipmh is a maintained fork of infrae/pyoai, which has received no substantive changes since March 2022. The public API and import path are unchanged; only the PyPI distribution name has changed, from pyoai to oaipmh, to distinguish the maintained release from the abandoned upstream package.

Maintenance since the fork has focused on bringing the codebase onto current Python infrastructure while preserving behaviour for existing consumers:

  • Supported on Python 3.11 through 3.15; legacy Python 2 shims removed.
  • Deprecated datetime.utcnow() replaced with timezone-aware alternatives.
  • Modern packaging using PEP 621 metadata and the Hatchling build backend.
  • CI pipeline rebuilt on uv, replacing the legacy tox configuration.
  • Reproducible development environment via a Nix flake and direnv.
  • Modernised test suite with CI coverage across the full supported Python range.

Scope

oaipmh is a maintained fork. Bug fixes and compatibility work are the primary focus; well-scoped feature proposals are welcome via GitHub Issues and Pull Requests. See CONTRIBUTING.md for guidelines.

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for local development setup, branch naming, commit conventions, and the release process.

Support

Bug reports and questions are accepted via GitHub Issues. Maintenance is best-effort with no formal SLA.

Acknowledgements

We are grateful to the original infrae/pyoai authors at Infrae and to the many community contributors who built and maintained this library over two decades; this fork would not exist without their work.

License

Distributed under the BSD-3-Clause License.
Copyright © 2026 ETH Zurich, Jaime Cardozo; ETH Library.
Based on infrae/pyoai by Infrae and community contributors.

See LICENSE for the full license terms and CHANGELOG.md for the release history.

Metadata

Release files for oaipmh 4.0.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 oaipmh 4.0.0
File Size Uploaded
oaipmh-4.0.0.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oaipmh 4.0.0
File Interpreter ABI Platform
oaipmh-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.3 kB

Release files / oaipmh-4.0.0.tar.gz

Download URL oaipmh-4.0.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1a968c65da1398d0c17808c2add880e8b757e27f477da8cb11f016725d85bcc
BLAKE2b-256 checksum
How to use checksums
6a28b60b0c0b6ae1aedf27a1c55b5533213d3f7a360a7965622eb3b2da730e22
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 12, 2026.

Transparency log

Release files / oaipmh-4.0.0-py3-none-any.whl

Download URL oaipmh-4.0.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50ca8dcfaf7ad2210680fcfa3801bc76f1b9380b9a4bf9726a1a5aaaec566378
BLAKE2b-256 checksum
How to use checksums
b80deba9b72ee7cb48d61fdb5bda5172e334aa6140d45e355802a6432943ef8e
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

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