Skip to main content

MultiRanges

Project description

multiranges

MultiRanges generate (laz) 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

GNU GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiranges-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

multiranges-0.0.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file multiranges-0.0.1.tar.gz.

File metadata

  • Download URL: multiranges-0.0.1.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

Hashes for multiranges-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c7fd9e93e3c15f03ec621e679198a3793ecce7434cf4841c9f2237fe96f0406
MD5 f2276cc295ab5b5baa0bb234d998f405
BLAKE2b-256 f0bb07c02cc45775ddf2dc8419c8fdf9677a39e0db56648d579e01dda8280704

See more details on using hashes here.

File details

Details for the file multiranges-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: multiranges-0.0.1-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

Hashes for multiranges-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a236721e92ba3e84feaa4b6320d2e80d02ad06be8217b41ca0170f81dc478fe5
MD5 a5f9206cb2d6670c4698fdc8ab33b7d3
BLAKE2b-256 e1d4b21ae33b29562b59e7c8228c1ebe960666e97aeb16ab296e3fa59d17f2e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page