This package help you to easily reduce the data input.
Project description
- Info:
DataReducer is an python tool for easily handling data.
- Repository:
- 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
Built Distribution
Close
Hashes for python_data_reducer-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36f354a7a7da98ea1c6a60befd2484e357803fe6c55a52ac360e41219389fd26 |
|
MD5 | ea5762b82bb3edb56195e4e39897dd8a |
|
BLAKE2b-256 | 89c1c86601c8cf5cb9cfb2314638807e8c8a075ca26b85c0bf4670b01aa11c3c |
Close
Hashes for python_data_reducer-0.0.6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f6a2818ccba523ccdf35282a1fc22f467d742aaba6f15f56386254638a97341 |
|
MD5 | b46d17d67542c5c1786fbfddf59c201d |
|
BLAKE2b-256 | 09ee5a4d32bf5a778d13db21a9a3cf520685dd56fe0593218cbaf1c1f0dc4ad7 |