<commit_before>******************************
processr - process your dicts!
******************************


.. image:: https://img.shields.io/travis/entropiae/processr.svg
    :target: https://travis-ci.org/entropiae/processr
    :alt: Travis-CI

WIP. If you're interested, reach me on `twitter <https://twitter.com/entropiae>`_.<commit_msg>Added example to README<commit_after>******************************
processr
******************************


.. image:: https://img.shields.io/travis/entropiae/processr.svg
    :target: https://travis-ci.org/entropiae/processr
    :alt: Travis-CI


processr provides a way to apply processing pipelines (expressed as list/dict/tuples) to Python dicts.

Example
=======
The following snippet will increment the value for the key `the_answer` and then change its key to `not_the_answer`.

.. code-block:: python

    >>> from processr.processr import process
    >>> from processr.transformers import set_value
    >>> input_dict = {'the_answer': 42}

    >>> pipeline = [
    ...   ('transform_values', {'the_answer': lambda value: value + 1}),
    ...   ('rename_keys', {'the_answer': 'not_the_answer'})
    ... ]
    ... process(input_dict, pipeline)
    {'the_answer': 43}


Stages description
========================
TODO

WIP. If you're interested, reach me on `twitter <https://twitter.com/entropiae>`_.
{'fraction_non_alphanumeric': 0.23503325942350334, 'fraction_numerical': 0.003695491500369549, 'mean_word_length': 4.187739463601533, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 6, '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': '1482277', 'n_tokens_mistral': 422, 'n_tokens_neox': 396, 'n_words': 102}