Skip to main content

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


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

grocery-1.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file grocery-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: grocery-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for grocery-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0389c3cd5dfdaf2a900c9f0d0815b3aaa669a07de1929bff11d19d13116ee92b
MD5 54345b7c316b2834b858a4576d67ae13
BLAKE2b-256 285ae8d71be6f149eb012bb6e1ed2cef26f6441d97f075143895092a483248af

See more details on using hashes here.

Supported by

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