Python implementation of the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH)
Project description
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:
- Python 3.10+ baseline; legacy Python 2 compatibility code 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.
- Test suite modernised and running green across Python 3.10 – 3.13.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oaipmh-3.0.1.tar.gz.
File metadata
- Download URL: oaipmh-3.0.1.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca181e7efd5aa1f3c292f49b440955d7c3cb5c1b989806e146fb7ae53bad9fe
|
|
| MD5 |
95da2b031fe75a64c3a1b2e1e1455c19
|
|
| BLAKE2b-256 |
9a7aef3ef5dc5d77be9db7dc6b26795fa9e926b5d2b947777c83ac38481bedb6
|
Provenance
The following attestation bundles were made for oaipmh-3.0.1.tar.gz:
Publisher:
publish.yml on eth-library/oaipmh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oaipmh-3.0.1.tar.gz -
Subject digest:
0ca181e7efd5aa1f3c292f49b440955d7c3cb5c1b989806e146fb7ae53bad9fe - Sigstore transparency entry: 1312341539
- Sigstore integration time:
-
Permalink:
eth-library/oaipmh@047885e124e7c7a3edae2da1d4601f3482ae1dad -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/eth-library
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@047885e124e7c7a3edae2da1d4601f3482ae1dad -
Trigger Event:
release
-
Statement type:
File details
Details for the file oaipmh-3.0.1-py3-none-any.whl.
File metadata
- Download URL: oaipmh-3.0.1-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed9f20e69009e0ed93fa63afa0d36560ef270de35dde670ae7391b1e02cd8c1
|
|
| MD5 |
0410b7b17b80aed09b55768e5fd56d98
|
|
| BLAKE2b-256 |
8d2fe886cc0bb72d9c9df5af6a81f779410ba398d25bb01bacf9b9f61fae7b70
|
Provenance
The following attestation bundles were made for oaipmh-3.0.1-py3-none-any.whl:
Publisher:
publish.yml on eth-library/oaipmh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oaipmh-3.0.1-py3-none-any.whl -
Subject digest:
7ed9f20e69009e0ed93fa63afa0d36560ef270de35dde670ae7391b1e02cd8c1 - Sigstore transparency entry: 1312341622
- Sigstore integration time:
-
Permalink:
eth-library/oaipmh@047885e124e7c7a3edae2da1d4601f3482ae1dad -
Branch / Tag:
refs/tags/v3.0.1 - Owner: https://github.com/eth-library
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@047885e124e7c7a3edae2da1d4601f3482ae1dad -
Trigger Event:
release
-
Statement type: