oaipmh
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.10 or newer.
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
pyoaiwithoaipmhin your requirements (pip install oaipmh). - Import paths are unchanged —
from oaipmh import ...continues to work. - The minimum supported Python version is 3.10.
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.10 through 3.14; 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 legacytoxconfiguration. - 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 3.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oaipmh-3.2.1.tar.gz | 26.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oaipmh-3.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.0 kB
Release files / oaipmh-3.2.1.tar.gz
| Download URL | oaipmh-3.2.1.tar.gz |
|---|---|
| Size | 26.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b24f0e0ef3dd0be1c2e471a0f00d506b9827d2477a80bdd244ea4f433331a593
|
|
BLAKE2b-256 checksum How to use checksums |
b0a6064b5ca9a160d85da254dac942f196e8c5c5c662326fb95d8f798234ee07
|
| 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 Sep 9, 2026.
Transparency logRelease files / oaipmh-3.2.1-py3-none-any.whl
| Download URL | oaipmh-3.2.1-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d251f931db55acbf99b61b7d00447c27f4515d6dd7a5f6d5cf116c6075ffceb1
|
|
BLAKE2b-256 checksum How to use checksums |
39ee3677cf47c66d446d7508247dc539fccf5712358ec39bfea453bed7d90654
|
| 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 Sep 9, 2026.
Transparency log