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
Release history Release notifications | RSS feed
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.4.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pysnippets-1.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f0050d5f2b089de0259e2d618a35cc3443b841be8b2e42bae1a9692eb98088 |
|
MD5 | 0f3bd94b78d78bf501eb539b7bec2fcb |
|
BLAKE2b-256 | 8f4c2feaa9820e333bc2d8df01548606ca6f2db6632e2ea38509dff1c0589c6d |