infrae / pyoai

The oaipmh module is a Python implementation of an "Open Archives$ Initiative Protocol for Metadata Harvesting"
http://pypi.python.org/pypi/pyoai
Other
84 stars 53 forks source link

Reading metadata results #40

Closed JesusMtzS closed 5 years ago

JesusMtzS commented 5 years ago

I'm running this code:

`from oaipmh.client import Client from oaipmh.metadata import MetadataRegistry, oai_dc_reader

URL = 'http://revista-iberoamericana.pitt.edu/ojs/index.php/Iberoamericana/oai' registry = MetadataRegistry() registry.registerReader('oai_dc', oai_dc_reader) client = Client(URL, registry)

for record in client.listRecords(metadataPrefix='oai_dc'): print(record) ` i was especting a kind of xml file on tuples, but the results are like this:

(<oaipmh.common.Header object at 0x00000251FAA16A20>, <oaipmh.common.Metadata object at 0x00000251FAA160B8>, None) (<oaipmh.common.Header object at 0x00000251FA9DB5C0>, <oaipmh.common.Metadata object at 0x00000251FA9C6518>, None) (<oaipmh.common.Header object at 0x00000251FA9DB0F0>, <oaipmh.common.Metadata object at 0x00000251FA9DB208>, None)

could you tellme if i'm forgetting something

wetneb commented 5 years ago

Hi! pyoai does the XML parsing for you, so the XML you are looking for is converted to these Metadata objects that you see. You should be able to access your data from them.

JesusMtzS commented 5 years ago

Thank you so much I was handling the objects in a bad way