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 details)
Built Distribution
File details
Details for the file iterify-0.1.0.tar.gz
.
File metadata
- Download URL: iterify-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0283515c938e97ec296e864937c5237d8d071312b2b2a9df415bbc47110d7366 |
|
MD5 | 645db41aaa75d4ef95c6e651774b652d |
|
BLAKE2b-256 | a40915afeeee224ede2e8568141ec7982804788e6e1c040723d3458caa0ccb73 |
File details
Details for the file iterify-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: iterify-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0674dae5dec445feeffd5640be96e1bd6d429e61fa958c1b2c8a526c3c654cf |
|
MD5 | dd0e6fd29c66dad97c15fe455cd10798 |
|
BLAKE2b-256 | 45f467256b40a98b63a33f7487a09af41de6624033dcaf908d99e3ab0381ea22 |