a-kits
Two ways to cut a sequence into batches: by fixed size, or into a fixed number of near-equal parts. Useful for pagination, bulk API calls and worker sharding.
Install
pip install a-kits
Usage
from a_kits import split_equal, split_fixed
split_fixed(range(5), 2) # [[0, 1], [2, 3], [4]]
split_equal(range(7), 3) # [[0, 1, 2], [3, 4], [5, 6]]
split_equal([1, 2], 3) # [[1], [2], []]
Guarantees
| Function | Guarantee |
|---|---|
split_fixed |
every part except the last has exactly m_batch items |
split_equal |
exactly m_share parts, sizes differ by at most one, order preserved |
Both accept any iterable and return lists. A non-positive size raises
ValueError instead of silently returning something useless.
License
MIT
Metadata
Release files for a-kits 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| a_kits-0.0.2.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a_kits-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / a_kits-0.0.2.tar.gz
| Download URL | a_kits-0.0.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
551334af02c43d3cf883c6a6538f928397ee48d0a83695d2cd47d7fd6cc3a464
|
|
BLAKE2b-256 checksum How to use checksums |
d9b0ddbba4826c47716880cc0f2ecb3ea738202e5cecd1ee5ca2ed93e1263a98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / a_kits-0.0.2-py3-none-any.whl
| Download URL | a_kits-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7444a213316553ef182c35b2f0de1400a14d9f56e3882ffdafdbc0f10d537b95
|
|
BLAKE2b-256 checksum How to use checksums |
b14143832f1d5b65a96a64fb0eeb88d22f92b3d1ed59e766ddf5f60070026ccb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for a-kits 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.