Skip to main content

Shuffled: Random iterators for large integer ranges

Shuffled is a library for iterating randomly and without repetition over integer ranges. It doesn’t store all the integers in memory so that you can work with ranges of up to 2128 elements, even with your standard RAM available.

Installation

pip install shuffled

Usage

Example: Generating a permutation of integers.

>>> from shuffled import Shuffled
>>> shuffled_range = Shuffled(10)
>>> list(shuffled_range)
[4, 1, 2, 9, 8, 5, 3, 0, 6, 7]
>>> same_shuffled_range = Shuffled(10, seed=shuffled_range.seed)
>>> list(same_shuffled_range)
[4, 1, 2, 9, 8, 5, 3, 0, 6, 7]

Example: Listing all IP addresses in a subnet in random order.

>>> import ipaddress
>>> from shuffled import Shuffled
>>> network = ipaddress.IPv4Network('10.0.0.0/8')
>>> shuffled_range = Shuffled(network.num_addresses)
>>> for index in shuffled_range:
...     print(network[index])
...
10.24.41.126
10.67.199.15
10.240.82.199
10.79.219.74
10.166.105.25
10.19.5.91
# Continues for all 16M addresses in the subnet

Release

  • Update the changelog.
  • Bump the version identified in pyproject.toml.
  • After those changes are merged into main, tag the commit on main and push it.
    • The CI/CD process will publish the new package version on PyPI.

Metadata

Release files for shuffled 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shuffled 1.2.0
File Size Uploaded Provenance Actions
shuffled-1.2.0.tar.gz 66.0 kB With provenance Details for shuffled-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shuffled 1.2.0
File Interpreter ABI Platform Actions
shuffled-1.2.0-py3-none-any.whl Python 3 none any Details for shuffled-1.2.0-py3-none-any.whl

Total release size: 71.3 kB

Release files / shuffled-1.2.0.tar.gz

Download URL shuffled-1.2.0.tar.gz
Size 66.0 kB
Tags Source
SHA-256 checksum
How to use checksums
488e1826363074942a64f5d1cdbd04308e7737b61bec33935543f6b913caaf1a
BLAKE2b-256 checksum
How to use checksums
a91b9c64bc6a86ea44200fc01a985327613fbc0eef5cec5d051508e41fcbb2a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / shuffled-1.2.0-py3-none-any.whl

Download URL shuffled-1.2.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1836956b18976f4f7af6c74ba0cdb1d855504e0fbf90e4bb6f374cb2378ee9f5
BLAKE2b-256 checksum
How to use checksums
d1ba787c1067d6bc30c7cfbba1a8d0c10214d48bfa9cbcbeb3a63e65ce6063c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Security for shuffled 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shuffled-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page