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

Uploaded Source

Built Distribution

pysnippets-1.1.1-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pysnippets-1.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/18.5 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.10

File hashes

Hashes for pysnippets-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d746b88972f472e77a2d929c4e5cbb5531c2441beeb0dc7e2426ac0ca70562e3
MD5 65f19ac2660efbb5990b409f30103157
BLAKE2b-256 c6a1908336e066231fb20d8e25fec2b60f55b2ce2cd579d8a8525fcd3cb6e4f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysnippets-1.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/18.5 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.10

File hashes

Hashes for pysnippets-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 536316fc55047014c5db1a9982686be2fce9055a810f028ff876a37e84c719b2
MD5 570114a1a73439b98bc292be5a59c2de
BLAKE2b-256 876bcdddd3258e290850200e66a8099acbae968667901b2bfe9964b2bee64a80

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