mloesch / sickle

Sickle: OAI-PMH for Humans
Other
106 stars 42 forks source link

Sickle output #5

Closed Aubreymcfato closed 9 years ago

Aubreymcfato commented 9 years ago

I easily installed and run Sickle, but the data I get from the OAI-PMH endpoint are formatted in a strange format which is neither a python dictionary nor a JSON, and I can't seem to parse it well. I don't understand how I can set the output (XML? JSON?), I didn't find anything in the documentation.

mloesch commented 9 years ago

Can you post the URL of the OAI-PMH endpoint?

Aubreymcfato commented 9 years ago

Yes: http://leo.cineca.it/index.php/jlis/oai

I contacted the dev ot the Journal (I know him personally), and he says there are no issues with that.

mloesch commented 9 years ago

Works as expected:

In [1]: from sickle import Sickle

In [2]: sickle = Sickle('http://leo.cineca.it/index.php/jlis/oai')

In [3]: records = sickle.ListRecords(metadataPrefix='oai_dc')

In [4]: record = records.next()

In [5]: record.metadata
Out[5]: 
{'contributor': [None, None],
 'creator': ['Manoni, Paola'],
 'date': ['2013-01-15'],
 'description': ["This paper will focus on the application profiles recently implemented in the new Vatican Library's discovery tool that interacts with interoperability standards and manages different metadata. The presentation will also take into consideration what the Library is planning for accessing web-based digitized manuscripts collections.",
  "This paper will focus on the application profiles recently implemented in the new Vatican Library's discovery tool that interacts with interoperability standards and manages different metadata. The presentation will also take into consideration what the Library is planning for accessing web-based digitized manuscripts collections."],
 'format': ['application/pdf', 'application/pdf'],
 'identifier': ['http://leo.cineca.it/index.php/jlis/article/view/5516',
  '10.4403/jlis.it-5516',
  'urn:nbn:it:unifi-3892',
  'http://leo.cineca.it/index.php/jlis/article/download/5516/7915'],
 'language': ['eng', 'ita'],
 'publisher': [u'Universit\xe0 di Firenze  Dipartimento di Storia, Archeologia, Geografia, Arte e Spettacolo'],
 'relation': ['http://leo.cineca.it/index.php/jlis/article/view/5516/7915',
  'http://leo.cineca.it/index.php/jlis/article/view/5516/7916'],
 'rights': ['Copyright (c) 2013 Paola Manoni',
  'http://creativecommons.org/licenses/by/4.0'],
 'source': ['JLIS.it; Vol. 4, No. 1 (2013): Global Interoperability and Linked Data in Libraries: Special issue; 425',
  'JLIS.it; Vol. 4, No. 1 (2013): Global Interoperability and Linked Data in Libraries: Special issue; 425',
  '2038-1026',
  '2038-5366'],
 'subject': [None,
  'Manoscritti della Biblioteca Vaticana; Library linked data',
  None,
  None,
  'Vatican Library-Manuscripts collections; Library linked data',
  None],
 'title': ['Metadata framework and application profiles in the global structure of catalogs and digitization projects of the Vatican Library',
  'Il contesto dei metadati ed i profili applicativi nella struttura globale dei cataloghi e nei progetti di digitalizzazione della Biblioteca Apostolica Vaticana'],
 'type': ['info:eu-repo/semantics/article',
  'info:eu-repo/semantics/publishedVersion',
  'Peer-reviewed Article']}
Aubreymcfato commented 9 years ago

Uh, ok. It's probably that I'm a real newbie and that is the problem, but I tried hard to work with that output, but it's neither a python dictionary nor a JSON, and I can't manage to parse it (well, I can try with the regex, but I think it's the last resort). What am I missing? Sorry for the bother.

Aubreymcfato commented 9 years ago

-_____-""

Ok, it seems that I didn't get that the Sickle object is a python dictionary...

  for record in records:
        print record.metadata["title"]
        print record.metadata["identifier"]

Can I humbly suggest to put some examples in the documentation? Thank you :-)