A grocery helper
Project description
grocery
grocery is a toolkit which is collected on my daily work.
Requirements
You will need the following prerequisites in order to use grocery:
- Python 3.6+
Installation
To install grocery:
.. code-block:: bash
$ pip install grocery
Introduction
list_ext which an enhancement of built-in list objects. It can filter the dict-list. e.g.: You have the following dict-list, and want to filter the items which are 'a' > 3 and 'b' >= 4:
dict of list:
dict_of_list = [
{'a': 1, 'b': 2},
{'a': 4, 'b': 3},
{'a': 3, 'b': 8},
{'a': 6, 'b': 10},
{'a': 2, 'b': 9}
]
Usage:
from grocery.builtins_ext import list_ext
l = list_ext(dict_of_list)
for item in l.filter_dict(a__gt=3, b__ge=4):
print(item)
# output: {'a': 6, 'b': 10}
Other introduction is coming
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file grocery-1.4.3-py3-none-any.whl
.
File metadata
- Download URL: grocery-1.4.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4653b8b9fa7bb9da424101c11a1255ea0de40387c98789afe4255a1b1f874fd |
|
MD5 | ee6d0fb56f537252febadd1636214150 |
|
BLAKE2b-256 | 149abac3c38c80f16f05ad0705fab4293fb28966641d986929a20e8c20d79e90 |