Skip to content

Commit

Permalink
Incluindo possibilidade de carregar uma arquivo de citações em memória
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobatalha committed Nov 21, 2016
1 parent 24f17cc commit a8ead1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions citedby/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

_DOCUMENTS = {}

with open(_CURRENT_DIR + '/data/citations.json', 'r') as metrics:
filepath = os.environ.get(
'CITEDBYAPI_HEAP_FILE', _CURRENT_DIR + '/data/citations.json')

for line in metrics:
with open(filepath, 'r') as metrics:

for line in metrics:
item = json.loads(line)

_DOCUMENTS[item['article']['code']] = item


Expand Down
2 changes: 1 addition & 1 deletion citedby/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(self, domain=None):
"""
Cliente thrift para o Articlemeta.
"""
self.domain = domain or '127.0.0.1:11620'
self.domain = domain or 'citedby.scielo.org:11610'
self._set_address()

def _set_address(self):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
thriftpy==0.3.1
thriftpy==0.3.9
requests==2.11.1
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
from setuptools import setup, find_packages

install_requires = [
'thriftpy>=0.3.1',
'requests>=2.8.1',
'thriftpy>=0.3.9',
'requests>=2.11.1',
'xylose>=1.16.5'
]

tests_require = []

setup(
name="citedbyapi",
version="1.0.2",
version="1.1.2",
description="Library that implements the endpoints of the CitedBy API",
author="SciELO",
author_email="scielo-dev@googlegroups.com",
Expand Down

0 comments on commit a8ead1e

Please sign in to comment.