Skip to main content

Python implementation of the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH)

Project description

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.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 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.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 legacy tox configuration.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oaipmh-3.0.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oaipmh-3.0.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

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

Hashes for oaipmh-3.0.1.tar.gz
Algorithm Hash digest
SHA256 0ca181e7efd5aa1f3c292f49b440955d7c3cb5c1b989806e146fb7ae53bad9fe
MD5 95da2b031fe75a64c3a1b2e1e1455c19
BLAKE2b-256 9a7aef3ef5dc5d77be9db7dc6b26795fa9e926b5d2b947777c83ac38481bedb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for oaipmh-3.0.1.tar.gz:

Publisher: publish.yml on eth-library/oaipmh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for oaipmh-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed9f20e69009e0ed93fa63afa0d36560ef270de35dde670ae7391b1e02cd8c1
MD5 0410b7b17b80aed09b55768e5fd56d98
BLAKE2b-256 8d2fe886cc0bb72d9c9df5af6a81f779410ba398d25bb01bacf9b9f61fae7b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for oaipmh-3.0.1-py3-none-any.whl:

Publisher: publish.yml on eth-library/oaipmh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page