Metadata-Version: 2.1
Name: cherrypicker
Version: 0.2.1
Summary: Pluck and flatten complex data.
Home-page: https://cherrypicker.readthedocs.io
License: UNKNOWN
Keywords: cherrypicker data etl extract flatten jquery
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.6
Requires-Dist: joblib (>=0.13.0)
Provides-Extra: dev
Requires-Dist: check-manifest ; extra == 'dev'
Requires-Dist: sphinx ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest-xdist ; extra == 'test'
Requires-Dist: tox ; extra == 'test'

Cherrypicker
------------

*Flatten complex data.*

``cherrypicker`` aims to make common ETL tasks (filtering data and
restructuring it into flat tables) easier, by taking inspiration from jQuery
and applying it in a Pythonic way to generic data objects.

.. code-block:: bash

    pip install cherrypicker

``cherrypicker`` provides a chainable filter and extraction interface to
allow you to easily pick out objects from complex structures and place them in
a flat table. It fills a similar role to jQuery in JavaScript, enabling you to
navigate complex structures without the need for lots of complex nested for
loops or list comprehensions.

Examples
++++++++

.. code-block:: python

    >>> from cherrypicker import CherryPicker
    >>> import json
    >>> with open('climate.json', 'r') as fp:
    ...     data = json.load(fp)
    >>> picker = CherryPicker(data)

.. code-block:: python

    >>> picker['id', 'city'].get()
    [[1, 'Amsterdam'], [2, 'Athens'], [3, 'Atlanta GA'], ...]

.. code-block:: python

    >>> picker(city='B*')['info'](
    ...     population=lambda n: n > 2000000,
    ...     area=lambda a: a < 2000
    ... )['area', 'population'].get()
    [[1568, 8300000], [891, 3700000], [203, 2800000]]

More complex filtering and flattening of nested structures is possible. Learn
more in the documentation: https://cherrypicker.readthedocs.io.


