Skip to content

Instantly share code, notes, and snippets.

@fabiobatalha
Created May 22, 2017 16:16
Show Gist options
  • Save fabiobatalha/1b8f72741cd2486e9909f3232d3f87e5 to your computer and use it in GitHub Desktop.
Save fabiobatalha/1b8f72741cd2486e9909f3232d3f87e5 to your computer and use it in GitHub Desktop.
import json
from xylose.scielodocument import Article
def load_document_from_file(filename):
with open(filename, 'r') as f:
for line in f:
data = json.loads(line)
article = Article(data)
yield article
for doc in load_document_from_file('0034-7329.json'):
"""
Do you mess here
"""
print(
doc.original_title(),
doc.publication_date,
doc.journal.title,
doc.issue.label,
len(doc.citations)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment