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 hashes)