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.3.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file pysnippets-1.1.3.tar.gz
.
File metadata
- Download URL: pysnippets-1.1.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 555aedf84e9f27e5bf5247275b87e8517899fa32bc1eaf1eb3e0b18d8ee48879 |
|
MD5 | da07df5043506e47ba6fdd023a82832a |
|
BLAKE2b-256 | 480313e76c4ec5ed61399d5a7adaf8cb8bdfabbf37e5136a4a83db728821641d |
File details
Details for the file pysnippets-1.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pysnippets-1.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dd3d0ddb2446c4b467b5127689f3a0ca376b152760e3d6d4648a02ef6892a1a |
|
MD5 | 83ecd7532c13d8cd77297128de944d1e |
|
BLAKE2b-256 | 1bc960404454c80015f099a546ca79f23d2cef56ca006026ab03c79f9053c6ba |