<commit_before>===============================
pyAltmetric
===============================

.. image:: https://badge.fury.io/py/pyaltmetric.png
    :target: http://badge.fury.io/py/pyaltmetric

pyAltmetric is a python wrapper for `Altmetric API v1 <http://api.altmetric.com>`_. 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**::
    
    from pyaltmetric import Altmetric

    a = Altmetric()

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

    a = Altmetric("api_key_goes_here")

**Querying the Altmetric.com database**::

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

**Reading a citation**::
    
    
    >>> from pyaltmetric import Altmetric, Citation
    >>>
    >>> b = a.id("241939")
    >>> c = Citation(b)
    >>> print c.title
    u'Rebuilding Global Fisheries'
    >>> 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

    >>>
 
* Free software: BSD license


<commit_msg>	modified:   README.rst<commit_after>===============================
pyAltmetric
===============================

.. image:: https://badge.fury.io/py/pyaltmetric.png
    :target: http://badge.fury.io/py/pyaltmetric

pyAltmetric is a python wrapper for `Altmetric API v1 <http://api.altmetric.com>`_. 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**::
    
    from pyaltmetric import Altmetric

    a = Altmetric()

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

    a = Altmetric("api_key_goes_here")

**Querying the Altmetric.com database**::

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

**Reading a citation**::
    
    
    >>> from pyaltmetric import Altmetric, Citation
    >>>
    >>> b = a.id("241939")
    >>> c = Citation(b)
    >>> print c.title
    u'Rebuilding Global Fisheries'
    >>> c   # provides a snapshot of a citation's coverage across platforms.
    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

    >>>
 
* Free software: BSD license



{'fraction_non_alphanumeric': 0.16922514619883042, 'fraction_numerical': 0.059941520467836254, 'mean_word_length': 2.629973474801061, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '162012', 'n_tokens_mistral': 993, 'n_tokens_neox': 851, 'n_words': 225}