Skip to main content

Thin wrapper around the SciELO Manager RESTful API.

Project description

scieloapi.py

Thin wrapper around the SciELO Manager RESTful API.

[![Build Status](https://travis-ci.org/scieloorg/scieloapi.py.png?branch=master)](https://travis-ci.org/scieloorg/scieloapi.py)

Usage example:

import scieloapi

client = scieloapi.Client(‘some.user’, ‘some.api_key’)

for journal in client.journals.all():

print journal[‘id’], journal[‘title’]

How to install

You can install it via pip, directly from the github repo:

pip install -e git+git://github.com/scieloorg/scieloapi.py.git#egg=scieloapi

Basics

When a Client instance is initialized, the process automaticaly instrospects the API server in order to make available only the endpoints part of the specified API version. The API version may be passed as keyword argument version when creating the Client instance. If ommited, the highest version is used.

>>> client = scieloapi.Client('some.user', 'some.api_key', api_uri='http://manager.scielo.org/api/', version='v1')

Listing available endpoints:

>>> client.endpoints
[u'pressreleases', u'users', u'sections', u'sponsors', u'collections', u'changes', u'apressreleases', u'uselicenses', u'journals', u'issues']
>>>

Listing all items of an endpoint:

>>> for journal in client.journals.all(): print journal['title']
...
Acta Médica Costarricense
Acta Pediátrica Costarricense
Actualidades Investigativas en Educación
Adolescencia y Salud
Agronomía Costarricense
Agronomía Mesoamericana
Annali dell'Istituto Superiore di Sanità
Arquivos em Odontologia
Brazilian Journal of Oral Sciences
Bulletin of the World Health Organization
Cadernos de Saúde Pública
>>>

Listing items matching some params:

>>> for journal in client.journals.filter(collection='saude-publica'): print journal['title']
...
Annali dell'Istituto Superiore di Sanità
Bulletin of the World Health Organization
Cadernos de Saúde Pública
Ciência & Saúde Coletiva
Gaceta Sanitaria
MEDICC Review
Revista Brasileira de Epidemiologia
Revista Cubana de Salud Pública
Revista de Salud Pública
>>>

Getting a specific item:

>>> journal = client.journals.get(62)
>>> journal['title']
u'Acta M\xe9dica Costarricense'
>>>

Use license

This project is licensed under FreeBSD 2-clause. See LICENSE for more details.

History

0.2

  • Slumber dependency was removed. The module scieloapi.httpbroker was created to deal with http requests and responses.

  • Better test reports now using Nosetests + coverage.

  • Added method Client.fetch_relations to fetch all first-level relations of a document and replace the value by the full document.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

scieloapi-0.3.tar.gz (7.8 kB view details)

Uploaded Source

scieloapi-0.2.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file scieloapi-0.3.tar.gz.

File metadata

  • Download URL: scieloapi-0.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scieloapi-0.3.tar.gz
Algorithm Hash digest
SHA256 3fee10c823f1bc493865967d0d0be45a362aa158f55eea0691f314a62201f022
MD5 5e0e12d4598e56f28bdfc978af751eaf
BLAKE2b-256 69e33fdd3a817b3368b76f067e7ebd273b33abe00adaf184336e5ae6675fe344

See more details on using hashes here.

File details

Details for the file scieloapi-0.2.tar.gz.

File metadata

  • Download URL: scieloapi-0.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scieloapi-0.2.tar.gz
Algorithm Hash digest
SHA256 9bda6dce2a9fdb7376bda1514de9dd4737525c3920a58b2cdd1c3e2c0a9b2ca7
MD5 48766bdf7dbd6e1ff73a9f924ca51ed2
BLAKE2b-256 61dd03d8f47de143eef27752e064087b97b6c79e95e993e7e2b86c38a8457943

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page