MultiRanges
Project description
multiranges
MultiRanges generate (lazy) tuples as a cartesian product starting from ranges, tuples, strings, sets and nested MultiRanges
Installation
Use the package manager pip to install multiranges.
pip install multiranges
Usage
This idea was born from a proyect I had which required a large amount of data mixing objects.
from multiranges.multiranges import MultiRange
mr = MultiRange(2, 3) # Combines range(2) and range(3)
values = list(mr)
# values = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]
list(MultiRange(10)) # Acts like normal range(10)
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list(MultiRange('test', (1, 2, 3, 5, 8))
[('t', 1), ('t', 2), ('t', 3), ('t', 5), ('t', 8), ('e', 1), ('e', 2), ('e', 3), ('e', 5), ('e', 8), ('s', 1),
('s', 2), ('s', 3), ('s', 5), ('s', 8), ('t', 1), ('t', 2), ('t', 3), ('t', 5), ('t', 8)]
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what do you suggest.
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multiranges-0.0.2.tar.gz.
File metadata
- Download URL: multiranges-0.0.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d93f3af22562a59b4c896e8c1d5c4ef719ca653bd6d31530fa8b0404fa1fc6ef
|
|
| MD5 |
b89213bcb354d9139197d85c95423856
|
|
| BLAKE2b-256 |
a53ee30a201354197bb1099d81dbdb3cfabad102703bedace9f9b47ee65d08a5
|
File details
Details for the file multiranges-0.0.2-py3-none-any.whl.
File metadata
- Download URL: multiranges-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92d865f4b1f706545457e2d511fb89dfe5e7851b2ed232fe713d4d1de1085adf
|
|
| MD5 |
2a12fae6607529bb8968815ff1304650
|
|
| BLAKE2b-256 |
cb30534b03b2ecd34b444c9b3726532128e30988c6ebed2d13d53ca8265094f0
|