<commit_before>===========
serial-core
===========
.. |travis.png| image:: https://travis-ci.org/mdklatt/cookiecutter-python-lib.png?branch=master
   :alt: Travis CI build status
   :target: `travis`_
.. _travis: https://travis-ci.org/mdklatt/serial-python
.. _serial: http://github.com/mdklatt/serial-python


|travis.png|

The `serial`_ Python library provides extensible tools for reading and writing
record-oriented data in various formats. The core library provided here is
contained in the ``serial.core`` package. Library extensions will be contained
in their own packages under the ``serial`` namespace.


.. _py27: https://github.com/mdklatt/serial-python/tree/py27

The `py27`_ branch is for Python 2.7 compatibility; it is no longer actively
maintained.


Features
========
- Read/write delimited and fixed-width data
- Named, typed, and formatted data fields
- Filtering
- Aggregation
- Sorting


Basic Example
=============

.. code-block:: python

    """ Read a comma-delimited file.

    """
    from serial.core import DelimitedReader
    from serial.core import IntField
    from serial.core import StringField

    def name_filter(record):
        """ Convert name to upper case. """
        record["name"] = record["name"].upper()
        return record

    fields = (
        StringField("name", 0),
        IntField("age", 1))
    with DelimitedReader.open("ages.csv", fields, ",") as reader:
        reader.filter(name_filter)
        for record in reader:
            print("{name:s} is {age:d} years old".format(**record))


Requirements
============
.. _Sphinx: http://sphinx-doc.org
.. _pytest: http://pytest.org

- `Sphinx`_ (optional; required to build documentation)
- `pytest`_ (optional; required to run test suite)



Installation
============
.. _GitHub: https://github.com/mdklatt/serial-python

Install the library from `GitHub`_:

.. code-block:: shell

    $ python -m pip install git+git://github.com/mdklatt/serial-python.git<commit_msg>fixed Travis badge link in README [ci skip]<commit_after>###########
serial-core
###########

.. |travis.png| image:: https://travis-ci.org/mdklatt/serial-python.png?branch=master
   :alt: Travis CI build status
   :target: `travis`_
.. _travis: https://travis-ci.org/mdklatt/serial-python
.. _serial: http://github.com/mdklatt/serial-python


|travis.png|

The `serial`_ Python library provides extensible tools for reading and writing
record-oriented data in various formats. The core library provided here is
contained in the ``serial.core`` package. Library extensions will be contained
in their own packages under the ``serial`` namespace.


.. _py27: https://github.com/mdklatt/serial-python/tree/py27

The `py27`_ branch is for Python 2.7 compatibility; it is no longer actively
maintained.


========
Features
========
- Read/write delimited and fixed-width data
- Named, typed, and formatted data fields
- Filtering
- Aggregation
- Sorting


=============
Basic Example
=============

.. code-block:: python

    """ Read a comma-delimited file.

    """
    from serial.core import DelimitedReader
    from serial.core import IntField
    from serial.core import StringField

    def name_filter(record):
        """ Convert name to upper case. """
        record["name"] = record["name"].upper()
        return record

    fields = (
        StringField("name", 0),
        IntField("age", 1))
    with DelimitedReader.open("ages.csv", fields, ",") as reader:
        reader.filter(name_filter)
        for record in reader:
            print("{name:s} is {age:d} years old".format(**record))


============
Requirements
============
.. _Sphinx: http://sphinx-doc.org
.. _pytest: http://pytest.org

- `Sphinx`_ (optional; required to build documentation)
- `pytest`_ (optional; required to run test suite)


============
Installation
============
.. _GitHub: https://github.com/mdklatt/serial-python

Install the library from `GitHub`_:

.. code-block:: shell

    $ python -m pip install git+git://github.com/mdklatt/serial-python.git
{'fraction_non_alphanumeric': 0.16057668406661696, 'fraction_numerical': 0.004971414367387522, 'mean_word_length': 3.5571913929784826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4167848', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1196, 'n_words': 350}