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:

  • 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 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.

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.2.0.tar.gz (26.1 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.2.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file oaipmh-3.2.0.tar.gz.

File metadata

  • Download URL: oaipmh-3.2.0.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oaipmh-3.2.0.tar.gz
Algorithm Hash digest
SHA256 79235ef64cfdb39863919689c854e68989b6f9c40d016b01b65eaabce2bc0d4c
MD5 c055a6b3b537d1991116c1ba25f2c74e
BLAKE2b-256 580aec17bcfb5d1c3d25d9b5852cb59683182c29055ce3fae3cac6fd2c954e93

See more details on using hashes here.

Provenance

The following attestation bundles were made for oaipmh-3.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: oaipmh-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oaipmh-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 860df5046cf9cecde95f0638eff6a29f2443005effdb1545c6342930f1752be0
MD5 968231274209981f4d68b9432ac26226
BLAKE2b-256 f21f3f6fbdfb5ebc4ba4b2fb3ae7803522a5bf09403a94d7a3783edbd79b96ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for oaipmh-3.2.0-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