Chunks an iterator
Project description
PyChunk
A Python library to chunk list based on number of items or number of chunks
Why?
Two Reasons!
- Python doesn't come with out of box chunking functionality for lists. Hence I thought of writing a library instead of referring stackoverflow everytime
- I always wanted to publish a library in pypi
Installation
pip install pychunk
Usage
from pychunk import chunk
chunk([1, 2, 3, 4, 5], num_chunks=2)
chunk([1, 2, 3, 4, 5], num_items=3)
Tech Used
- Peotry for package management
- Pytest for testing
- Mypy for static code checking
This is my first time using python types in my project
Ahaa moments!
- I'm deeply suprised by how Poetry makes it so simple to publish a library. I always got list in setuptools and disttools
- But, I don't think poetry supports
pip install -e .
equivalent command - Looks like it's been added to Poetry 1.2. Need to figure out how it works.
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
pychunk-1.0.0.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file pychunk-1.0.0.tar.gz
.
File metadata
- Download URL: pychunk-1.0.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.6 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94317887710c1437455561b2d4f37b2edf75648de03fbd8f11317dac19363520 |
|
MD5 | 06336a796c140b5dfce7cbdfdd108a06 |
|
BLAKE2b-256 | 2f51e3d4fbcd9be88c2120aec1a384d013c46235485d9848995bcb8368be8bd9 |
Provenance
File details
Details for the file pychunk-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pychunk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.6 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7579c6f7e8cd279d035c3da10e52ccfe9983bdce011486e5fe8eb730db25e274 |
|
MD5 | ae949b5b20465cccaa16f43f5e9bd238 |
|
BLAKE2b-256 | c90705556b44295a42283e5af067fac3c7e0c91ec755de0dfb90d6088cabe0a5 |