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
str:
In [1]: import pysnippets.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.0.4.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file pysnippets-1.0.4.tar.gz
.
File metadata
- Download URL: pysnippets-1.0.4.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec86d9bb2958e2f1a179950fb6930dbdab8737e8bb4b5a97c596c568fddc70a2 |
|
MD5 | 2803dcee990e3105848cc0632e2a7caa |
|
BLAKE2b-256 | c0d68ea47ee0c628536ea97e5397f56b5c9a5d985a61462b95f6c3dbaeacff95 |
File details
Details for the file pysnippets-1.0.4-py2.py3-none-any.whl
.
File metadata
- Download URL: pysnippets-1.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5301f237fa5c633c00364f385378972a228d4b171d0575fc80e8863d8d990e70 |
|
MD5 | 5b81b913a9ebd574c5f02c866e61101d |
|
BLAKE2b-256 | 44580285081e7c2466b9216b2f9c3ba542e5efa187d6f4fb1cd50b3d869e542f |