Skip to main content

This package help you to easily reduce the data input.

Project description

Info:

DataReducer is an python tool for easily handling data.

Repository:

https://github.com/shinrel22/data_reducer

Author:

Tri Nguyen (https://github.com/shinrel22)

Maintainer:

Tri Nguyen (https://github.com/shinrel22)

Installation

pipenv install python-data-reducer

Examples

Some simple examples of what DataReducer can do:

from data_reducer import DataReducer

>>> origin_data = {
    'id': '1',
    'avatar': {
        'creator': {
            'birthday': {'day': 22, 'month': 1, 'year': 1993},
            'email': 'example@gmail.com',
            'id': '1',
            'name': 'example'
        },
        'deleted': False,
        'id': '1',
        'path': 'abc',
        'types': ['a', 'b', 'c'],
        'url': 'url'
    },
    'translations': [
        {'content': '1', 'id': '1', 'locale': 'vi', 'name': 'A'},
        {'content': '2', 'id': '2', 'locale': 'en', 'name': 'B'}
    ]
}

>>> only_fields = [
    'id',
    'translations.id',
    'translations.locale',
    'translations.name',
    'translations.types',
    'avatar.url',
    'avatar.id',
    'avatar.creator.id',
    'avatar.creator.birthday.year',
]

>>> DataReducer(data=origin_data, include_fields=only_fields).run()

{
    'id': '1',
    'translations': [
        {'id': '1', 'locale': 'vi', 'name': 'A'},
        {'id': '2', 'locale': 'en', 'name': 'B'}
    ],
    'avatar': {
        'url': 'url',
        'id': '1',
        'creator': {
            'id': '1',
            'birthday': {'year': 1993}
        }
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_data_reducer-0.0.6.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_data_reducer-0.0.6-py2-none-any.whl (4.3 kB view details)

Uploaded Python 2

File details

Details for the file python_data_reducer-0.0.6.tar.gz.

File metadata

  • Download URL: python_data_reducer-0.0.6.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for python_data_reducer-0.0.6.tar.gz
Algorithm Hash digest
SHA256 36f354a7a7da98ea1c6a60befd2484e357803fe6c55a52ac360e41219389fd26
MD5 ea5762b82bb3edb56195e4e39897dd8a
BLAKE2b-256 89c1c86601c8cf5cb9cfb2314638807e8c8a075ca26b85c0bf4670b01aa11c3c

See more details on using hashes here.

File details

Details for the file python_data_reducer-0.0.6-py2-none-any.whl.

File metadata

  • Download URL: python_data_reducer-0.0.6-py2-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for python_data_reducer-0.0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 0f6a2818ccba523ccdf35282a1fc22f467d742aaba6f15f56386254638a97341
MD5 b46d17d67542c5c1786fbfddf59c201d
BLAKE2b-256 09ee5a4d32bf5a778d13db21a9a3cf520685dd56fe0593218cbaf1c1f0dc4ad7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page