Skip to main content

Python Snippets

Project description

Python Snippets

Installation

pip install pysnippets

Usage

dict:

In [1]: from pysnippets import 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]: from pysnippets import 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

str:

In [1]: from pysnippets import strsnippets as ssn

In [2]: ssn.strip(None)

In [3]: ssn.strip(' xyz ')
Out[3]: 'xyz'

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.7.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

pysnippets-1.0.7-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pysnippets-1.0.7.tar.gz.

File metadata

  • Download URL: pysnippets-1.0.7.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.12+

File hashes

Hashes for pysnippets-1.0.7.tar.gz
Algorithm Hash digest
SHA256 96b75419248c86f4a032f09a992a788b4ab6e1d98193cb89781a899880f09b09
MD5 f7b68601ce0e3158745c6110430ddf26
BLAKE2b-256 9c4422fb4de498931470fcd5e080b81402b80e81ab05b0e4e1626e7f559b3b27

See more details on using hashes here.

File details

Details for the file pysnippets-1.0.7-py2.py3-none-any.whl.

File metadata

  • Download URL: pysnippets-1.0.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.12+

File hashes

Hashes for pysnippets-1.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c1d3833b149a0b8923c4164b96bdb1d240952c9e824f6150ffec69e0e6d9d0e
MD5 52561b0e52685d298a2008e8637343b2
BLAKE2b-256 0223ef57f0fafcc389ebac4dbc9515bb98ce037cabd77a390cedbee31c620a0f

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