iterify streamlines making one-off iterators over one or a few values
Project description
iterify
iterify streamlines making one-off iterators over one or a few values
Free software: MIT license
Documentation: https://iterify.readthedocs.io.
import iterify as itfy
# itfy.iterify
[*itfy.iterify('a')] # -> ['a']
[*itfy.iterify('a', 'b', 'c')] # -> ['a', 'b', 'c']
# itfy.cyclify
[*zip([1, 2, 3], itfy.cyclify('a', 'b'))] # -> [(1, 'a'), (2, 'b'), (3, 'a')]
# itfy.samplify
[*zip(
[1, 2, 3],
itfy.samplify('a', 'b')
)]
# -> [(1, 'a'), (2, 'a'), (3, 'b')]
# or -> [(1, 'b'), (2, 'a'), (3, 'b')]
# or -> [(1, 'b'), (2, 'b'), (3, 'b')]
# etc.
# itfy.shufflify
[*itfy.shufflify('a', 'b')]
# -> ['a', 'b']
# or -> ['b', 'a']
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.0.0 (2022-02-22)
First release on PyPI.
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
iterify-0.1.0.tar.gz
(10.1 kB
view hashes)
Built Distribution
Close
Hashes for iterify-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0674dae5dec445feeffd5640be96e1bd6d429e61fa958c1b2c8a526c3c654cf |
|
MD5 | dd0e6fd29c66dad97c15fe455cd10798 |
|
BLAKE2b-256 | 45f467256b40a98b63a33f7487a09af41de6624033dcaf908d99e3ab0381ea22 |