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.1.0.tar.gz (22.4 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.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for oaipmh-3.1.0.tar.gz
Algorithm Hash digest
SHA256 7f9434797ba85766420dd560208a86abbf52749b68f38f3aaa14def7ce9d4808
MD5 de997e7065dc518e8bc08288e4f504dd
BLAKE2b-256 0548f041a0272bc6cb9f9e74b4dd6f620f4feb4f642db481f9fe96785a1ddf8f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: oaipmh-3.1.0-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.13

File hashes

Hashes for oaipmh-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4fd196bef6fc75fff98efb19c5468ac952b4ad914f78559d8315f9870208545
MD5 397bf925e1f448fcb6b43725d3d787d0
BLAKE2b-256 7a4626408c04f59c7901fcbce948b9396bc777bb5acbffb7d2291f13883276a9

See more details on using hashes here.

Provenance

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