Skip to content

Instantly share code, notes, and snippets.

@aschweer
Created September 22, 2011 01:56
Show Gist options
  • Save aschweer/1233846 to your computer and use it in GitHub Desktop.
Save aschweer/1233846 to your computer and use it in GitHub Desktop.
Example python script to get record IDs from an OAI harvest
#!/usr/bin/env python
# uses http://www.infrae.com/download/OAI/pyoai
from oaipmh.client import Client
from oaipmh.metadata import MetadataRegistry, oai_dc_reader
URL = 'http://researchcommons.waikato.ac.nz/dspace-oai/request'
registry = MetadataRegistry()
registry.registerReader('oai_dc', oai_dc_reader)
client = Client(URL, registry)
for record in client.listRecords(metadataPrefix='oai_dc'):
print record[0].identifier()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment