Skip to content

python wrapper for Altmertic API v1 - altmetrics from Altmetric.com

License

Notifications You must be signed in to change notification settings

lizliveitup/pyAltmetric

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyAltmetric

https://badge.fury.io/py/pyaltmetric.png

pyAltmetric is a python wrapper for Altmetric API v1. It provides an API for downloading and reading citations both individually and in bulk.

Installation

pip install pyaltmetric

Usage

Fetching by individual citations by identifiers

You can fetch individual citations using DOI, PubMed ID, arxiv and ADS bibcode identifiers. A successful call will return a python dictionary:

from pyaltmetric import Altmetric

a = Altmetric()

a.id("241939")
a.doi("10.1038/news.2011.490")
a.pmid("21148220")
a.arxiv("1108.2455")
a.ads("2012apphl.100y3104b")

a = Altmetric("api_key_goes_here")

Querying the Altmetric.com database

You can query the Altmetric.com for a list of articles in a give timeframe. For more information on parameters see Querying the Database:

a.citations("1w", page=1, nlmid="0410462")

Reading a citation

pyAltmetric has a Citation object provides an friendly interface for accessing citation attributes. Citation's get_fields() method allows the retrieval of multiple attributes:

>>> from pyaltmetric import Altmetric, Citation
>>>
>>> b = a.id("241939")
>>> c = Citation(b)
>>> print c.title
u'Rebuilding Global Fisheries'

Using Citation, you can get a taste for a citation's impact across multiple platforms:

>>> c
Altmetrics on: "Rebuilding Global Fisheries" with doi 10.1126/science.1173146
published in Science.

All Posts      14
Tweets          6
Facebook        1
Google+         0
Reddit          0
Blogs           2

>>>

More examples

Copyright

Copyright (c) 2014 Will Earp

License

Free software: BSD license

About

python wrapper for Altmertic API v1 - altmetrics from Altmetric.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%