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

Uploaded Source

Built Distribution

pysnippets-1.0.6-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pysnippets-1.0.6.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysnippets-1.0.6.tar.gz
Algorithm Hash digest
SHA256 79c632436d98c484fed68d6d2bd59e9b50e1d74507c7aa69a0e313dfbebcd97c
MD5 d9ae43269703a7df7894e277eb9ec256
BLAKE2b-256 d36f900a095dbb2caeb3c7d84d8dc3cc7bdf4747f35fd15a7a46be1458697600

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysnippets-1.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 743e26a06e276af1c63fc89252025aa1c0fb42049a66da6752bcae446159e61e
MD5 937e9dc412049320da58bb3621e6c1b8
BLAKE2b-256 2fbe2e89145c10e8efadd8a25617c5522e0bdc94b93984e30028f581d16ec33e

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