Created
September 22, 2011 01:56
-
-
Save aschweer/1233846 to your computer and use it in GitHub Desktop.
Example python script to get record IDs from an OAI harvest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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