Skip to main content

Low Level Client for Crossref Search API

Project description

habanero

pypi docs travis coverage

This is a low level client for working with Crossref’s search API. It’s been named to be more generic, as other organizations are/will adopt Crossref’s search API, making it possible to ineract with all from one client.

Crossref API docs

Other Crossref API clients:

habanero includes three modules you can import as needed (or import all):

Crossref - Crossref search API. The Crossref module includes methods matching Crossref API routes, and a few convenience methods for getting DOI agency and random DOIs:

  • works - /works route

  • members - /members route

  • prefixes - /prefixes route

  • funders - /funders route

  • journals - /journals route

  • types - /types route

  • licenses - /licenses route

  • registration_agency - get DOI minting agency

  • random_dois - get random set of DOIs

counts - citation counts. Includes the single citation_count method

cn - content negotiation. Includes the methods:

  • content_negotiation - get citations in a variety of formats

  • csl_styles - get CSL styles, used in content_negotation method

Installation

Stable version

pip install habanero

Dev version

sudo pip install git+git://github.com/sckott/habanero.git#egg=habanero

# OR

git clone git@github.com:sckott/habanero.git
cd habanero
make install

Usage

Initialize a client

from habanero import Crossref
cr = Crossref()

Works route

x = cr.works(query = "ecology")
x.status()
x.message()
x.total_results()
x.items()

Members route

cr.members(ids = 98, works = True)

Citation counts

from habanero import counts
counts.citation_count(doi = "10.1016/j.fbr.2012.01.001")

Content negotiation - get citations in many formats

from habanero import cn
cn.content_negotiation(ids = '10.1126/science.169.3946.635')
cn.content_negotiation(ids = '10.1126/science.169.3946.635', format = "citeproc-json")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "rdf-xml")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "text")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "text", style = "apa")
cn.content_negotiation(ids = "10.1126/science.169.3946.635", format = "bibentry")

Changelog

0.1.3 (2015-12-02)

  • Fix wheel file to be a universal to install on python2 and python3 (#25)

  • Added method csl_styles to get CSL styles for use in content negotiation (#27)

  • More documentation for content negotiation (#26)

  • Made note in docs that sample param ignored unless /works used (#24)

  • Made note in docs that funders without IDs don’t show up on the /funders route (#23)

0.1.1 (2015-11-17)

  • Fix readme

0.1.0 (2015-11-17)

  • Now compatible with Python 2x and 3x

  • agency() method changed to registration_agency()

  • New method citation_count() - get citation counts for DOIs

  • New method crosscite() - get a citation for DOIs, only supports simple text format

  • New method random_dois() - get a random set of DOIs

  • Now importing xml.dom to do small amount of XML parsing

  • Changed library structure, now with module system, separated into modules for the main Crossref search API (i.e., api.crossref.org) including higher level methods (e.g., registration_agency), content negotiation, and citation counts.

0.0.6 (2015-11-09)

  • First pypi release

Project details


Download files

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

Source Distribution

habanero-0.1.3.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

habanero-0.1.3-py2.py3-none-any.whl (28.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file habanero-0.1.3.tar.gz.

File metadata

  • Download URL: habanero-0.1.3.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for habanero-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3135e06daa479d7b2e6267a994c9f5a194cf8c454f4f6781598a0e5ed5b6e724
MD5 ec6bbe9cce5050a285c3a94a0f582029
BLAKE2b-256 d7000a0fcd5ad9d7bccb52bbacea016f08ea860d62b20895dc317860015db914

See more details on using hashes here.

File details

Details for the file habanero-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for habanero-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 20ca5327fde807b713d26eda10e08f5d049ed41cc7ecb6a1b307dfa70ca1d9eb
MD5 8898c9ee6f5ee9431d8b41f83a4f5963
BLAKE2b-256 5f0bbadfd49b6ec3963bb0be5378167b758abd663cbf55fa8a67589ad9411389

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