<commit_before>pycounter
=========

pycounter makes working with [COUNTER](http://www.projectcounter.org/)
usage statistics in Python easy, including fetching statistics with NISO
[SUSHI](http://www.niso.org/workrooms/sushi)

Developed by the [Health Sciences Library System](http://www.hsls.pitt.edu) 
of the [University of Pittsburgh](http://www.pitt.edu)  to support importing
usage data into our in-house Electronic Resources Management (ERM) system.

Licensed under the MIT license. See the file LICENSE for details.

pycounter is tested on Python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy

Installing
----------
From [pypi](http://pypi.python.org/pypi/pycounter):

    pip install pycounter

From inside the source distribution:

    python setup.py install
    
Usage
-----

Parsing COUNTER reports (currently supports COUNTER 3 and 4, in .csv, .tsv, 
or .xlsx files, reports JR1, BR1, and BR2):

    >>> import pycounter.report
    >>> report = pycounter.report.parse("COUNTER4_2015.tsv")  # filename or path to file
    >>> print(report.metric)
    FT Article Requests
    >>> for journal in report:
    ...     print(journal.title)
    Sqornshellous Swamptalk<commit_msg>fix links to RST format<commit_after>pycounter
=========

pycounter makes working with `COUNTER <http://www.projectcounter.org/>`_
usage statistics in Python easy, including fetching statistics with NISO
`SUSHI <http://www.niso.org/workrooms/sushi>`_.

Developed by the `Health Sciences Library System <http://www.hsls.pitt.edu>`_ 
of the `University of Pittsburgh <http://www.pitt.edu>`_  to support importing
usage data into our in-house Electronic Resources Management (ERM) system.

Licensed under the MIT license. See the file LICENSE for details.

pycounter is tested on Python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy

Installing
----------
From `pypi <http://pypi.python.org/pypi/pycounter>`_:

    pip install pycounter

From inside the source distribution:

    python setup.py install
    
Usage
-----

Parsing COUNTER reports (currently supports COUNTER 3 and 4, in .csv, .tsv, 
or .xlsx files, reports JR1, BR1, and BR2):

    >>> import pycounter.report
    >>> report = pycounter.report.parse("COUNTER4_2015.tsv")  # filename or path to file
    >>> print(report.metric)
    FT Article Requests
    >>> for journal in report:
    ...     print(journal.title)
    Sqornshellous Swamptalk
{'fraction_non_alphanumeric': 0.12040557667934093, 'fraction_numerical': 0.01689902830587241, 'mean_word_length': 3.61598440545809, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5720837', 'n_tokens_mistral': 789, 'n_tokens_neox': 729, 'n_words': 248}