The oaipmh module is a Python implementation of the
Open Archives Initiative Protocol for Metadata Harvesting (version 2)
client and server.
pip install pyoaiOr with uv:
uv add pyoai
- Python 3.10+
- lxml
A simple OAI-PMH client:
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)The pyoai package also contains a generic server implementation of the OAI-PMH protocol. It is used as the foundation of the MOAI Server Platform.
uv sync --all-extras
uv run pytest