Skip to main content

Python Snippets

Project description

Python Snippets

Installation

pip install pysnippets

Usage

dict:

In [1]: import pysnippets.dictsnippets as dsn

In [2]: dsn.filter({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'])
Out[2]: {'c': 3, 'd': 4}

In [3]: dsn.filter({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'], exec_eval=False)
Out[3]: {'c': 3, 'd': '4'}

In [4]: dsn.gets({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'])
Out[4]: [3, 4]

In [5]: dsn.gets({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'], exec_eval=False)
Out[5]: [3, '4']

list:

In [1]: import pysnippets.listsnippets as lsn

In [2]: lsn.all([1, 2, 3], [1, 2])
Out[2]: True

In [3]: lsn.any([1, 2, 3], [1, 5])
Out[3]: True

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

pysnippets-1.0.3.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

pysnippets-1.0.3-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

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