Parsing Crossref Schema with Python
This file contains hidden or 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 | |
# coding: utf-8 | |
import os | |
import shutil | |
import argparse | |
import json | |
def dict_articles_press_releases(cisis_path, scielo_path): | |
query = os.popen('''{0}/mx {1}/bases/artigo/artigo btell=0 lw=0 AHPR=$ pft="v880,'|',v881,'|',v241^i/" -all now'''.format(cisis_path, scielo_path)) |
This file contains hidden or 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/python | |
import copy | |
class Originator(object): | |
class Memento(object): | |
def __init__(self, mstate): | |
self.mstate = mstate |
This file contains hidden or 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
import os | |
import re | |
from lxml import etree | |
ns = {'xs': 'http://www.w3.org/2001/XMLSchema', | |
'mml': 'http://www.w3.org/1998/Math/MathML', | |
'xsi': 'http://www.w3.org/2001/XMLSchema-instance', | |
'xlink': 'http://www.w3.org/1999/xlink'} | |
This file contains hidden or 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 | |
import os | |
import urllib2 | |
import json | |
import argparse | |
import pymongo | |
def get_books(api_host='localhost', api_port='5984'): |
This file contains hidden or 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
# encoding: utf-8 | |
import urllib2 | |
from xml.etree import ElementTree | |
from xml.etree.ElementTree import Element | |
from urllib import urlencode | |
class FindDoi(object): | |
def __init__(self, format='unixref'): |
This file contains hidden or 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
# coding: utf-8 | |
import json | |
import urllib2 | |
books = json.loads(urllib2.urlopen('http:/127.0.0.1:5984/scielobooks_1a/_design/scielobooks/_view/books').read()) | |
for row in books['rows']: | |
print u'|'.join( | |
[ |
This file contains hidden or 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
import json | |
import urllib, urllib2 | |
import urlparse | |
from unidecode import unidecode | |
CROSSREF_API_DOI = 'http://search.crossref.org/dois?' | |
def verify_doi(doi,article): | |
doi_query_url = 'http://search.crossref.org/dois?' + urllib.urlencode({'q': doi}) | |
response = json.loads(urllib2.urlopen(doi_query_url).read()) |
This file contains hidden or 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/python2.7 | |
# coding: utf-8 | |
import unittest | |
import datetime | |
def is_delayed(ratio, periodicity, last_publication_date): | |
""" | |
ratio (integer): numero de fasciculos para considerar o atraso. | |
periodicity (integer): periodicidade do periodico em meses 1, 2, 3, 4, 5..... |
This file contains hidden or 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
<li class="pdf-link"> | |
<img src="/img/readcube.png" width="21" heigth="21"> | |
<a href="http://www.readcube.com/articles/10.1590/S0004-28032012000300003?tab=summary" target="_blank">ReadCube</a> | |
</li> | |
<li class="readcube-epdf-link"> | |
<img src="/img/readcube.png" width="21" heigth="21"> | |
<a href="/readcube/epdf.php?doi=10.1590/S0004-28032012000300003&pid=S0004-28032012000300003&pdf_path=ag/v49n3/v49n3a03.pdf" title="Article in epdf format">ReadCube ePDF</a> | |
</li> |
OlderNewer