Useful utilities for Python
Project description
🍧 snowcone
Set of useful utilities for Python inspired by other libraries and languages
Requirements
- Python 3.6 or newer
🛠 Installation
To install the package, run the following command from a terminal:
$ pip install snowcone
🚀 Usage
JavaScript style arrays
Manipulate Python lists using a more object-oriented style JavaScript array syntax:
from snowcone.containers import Array
array = [
[
{"category": "A", "value": 0},
{"category": "A", "value": 2},
{"category": "A", "value": 4},
],
[
{"category": "B", "value": 7},
{"category": "B", "value": 3},
{"category": "B", "value": 9},
]
]
values = (
Array(array)
.flatten()
.filter(lambda x: x["category"] == "A")
.map(lambda x: x["value"] * 5)
.all()
)
print(values)
>>> [0, 10, 20, 35, 15, 45]
📚 Documentation
Documentation can be built using the command make docs
, which uses the Makefile
and the make
binary.
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
snowcone-0.3.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file snowcone-0.3.0.tar.gz
.
File metadata
- Download URL: snowcone-0.3.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a2ba863714352d1dbc4fba78cc243c6a0585a76919b4fa9e27a0510cd4f7b2 |
|
MD5 | bb3718b39e51507adeb38c28f8e2f0fe |
|
BLAKE2b-256 | e9010f6ba6b5cabf6ebb394c8c4b27b72d8939dbc80c444c7023fd42c2018da8 |
File details
Details for the file snowcone-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: snowcone-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab0637745e96da05eb5f2e756d1f6925f756f4d3fe99a3cc1044a61d8d0333f4 |
|
MD5 | 8c7241ad24f8ba8715ce4f0b54820766 |
|
BLAKE2b-256 | 6da055d75b72d7721fd56ede8c3cd3eeeeb3ef404cea3fd7858b5c945bb97c3b |