Pyudorandom is a Python library that generates pseudorandom sequences by using algebraic methods. It allows iteration over a list in a non-successive, yet deterministic way, ensuring each item is yielded exactly once. This is particularly useful when you need to mix up items without the overhead or cryptographic guarantees of true randomness, often outperforming `random.shuffle` for longer lists. The current version is 1.0.0, and releases are generally made on an as-needed basis.
pip install pyudorandomVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use `pyudorandom.shuffle()` to obtain a new list with elements in a deterministic, non-successive order, and `pyudorandom.items()` to iterate through them.
Always understand the deterministic nature of pseudorandom generators. For cryptographic needs, use `import secrets` and functions like `secrets.randbelow()` or `secrets.token_hex()`.
Benchmark for your specific use case. For small lists where performance is critical, `random.shuffle` might be a better choice. `pyudorandom` is optimized for significantly longer lists.
The `shuffle` function is a method of the `pyudorandom` module itself. You should `import pyudorandom` and then call `pyudorandom.shuffle(my_list)`.
Ensure you pass an iterable (e.g., a list or tuple) to `pyudorandom.shuffle()` or `pyudorandom.items()`. For example, `pyudorandom.shuffle([1, 2, 3])` works, but `pyudorandom.shuffle(123)` does not.
No dependency data recorded yet.