google/paranoid_crypto has a number of Randomness Tests in Python IIR
```md
# Randomness tests
## Goal of the tests
## Non-goals
## Usage
## Tests
### NIST SP 800-22
#### Frequency (Monobits) Test
#### Frequency Test within a Block
#### Runs Test
#### Test for the Longest Run of Ones in a Block
#### Binary Matrix Rank Test
#### Discrete Fourier Transform (Spectral) Test
#### Non-Overlapping Template Matching Test
#### Overlapping Template Matching Test.
#### Maurer’s “Universal Statistical” Test
#### Linear Complexity Test
#### Serial Test.
#### Approximate Entropy Test
#### Cumulative Sums (Cusum) Test.
#### Random Excursions Test.
#### Random Excursions Variant Test
### Additional tests
#### FindBias
#### LargeBinaryMatrixRank
#### LinearComplexityScatter
## Interface
### Repeating tests
## Testing
### Pseudorandom number generators for testing
#### urandom
#### mt19937
#### gmp_n
#### mwc_n
#### java
#### lcgnist
#### xorshift128+
#### xorshift*
#### xorwow
#### pcg64, philox, sfc64
#### jsf32, jsf64
## Design decisions
```
```python
class Rng:
class Urandom(Rng):
class Shake128(Rng):
class Mt19937(Rng):
class GmpRand(Rng):
class XorShift128plus(Rng):
class XorShiftStar(Rng):
class Xorwow(Rng):
class JavaRandom(Rng):
class LcgNist(Rng):
class Mwc(Rng):
class NumpyRng(Rng):
class Lehmer(Rng):
class Pcg64(NumpyRng):
class Philox(NumpyRng):
class Sfc64(NumpyRng):
class SubsetSum(Rng):
```
```python
NIST_TESTS = [
(nist_suite.Frequency, []),
(nist_suite.BlockFrequency, []),
(nist_suite.Runs, []),
(nist_suite.LongestRuns, []),
(nist_suite.BinaryMatrixRank, []),
(nist_suite.Spectral, []),
(nist_suite.NonOverlappingTemplateMatching, []),
(nist_suite.OverlappingTemplateMatching, []),
(nist_suite.Universal, []),
(nist_suite.LinearComplexity, [512]),
(nist_suite.LinearComplexity, [1024]),
(nist_suite.LinearComplexity, [2048]),
(nist_suite.LinearComplexity, [4096]),
(nist_suite.Serial, []),
(nist_suite.ApproximateEntropy, []),
(nist_suite.RandomWalk, []),
]
EXTENDED_NIST_TESTS = [
(extended_nist_suite.LargeBinaryMatrixRank, []),
# Computing the linear complexity has quadratic complexity.
# A consequence of this is that LinearComplexityScatter only
# uses a fraction of the input. A parameter [n, m] means
# that n m-bit sequences are tested, where the i-th sequence
# consists of the bits i, i + n, ..., i + (m-1) * m.
(extended_nist_suite.LinearComplexityScatter, [32, 100000]),
(extended_nist_suite.LinearComplexityScatter, [64, 50000]),
(extended_nist_suite.LinearComplexityScatter, [128, 40000]),
]
LATTICE_TESTS = [
(lattice_suite.FindBias, [256]),
(lattice_suite.FindBias, [384]),
(lattice_suite.FindBias, [512]),
(lattice_suite.FindBias, [1024]),
]
TESTS = NIST_TESTS + EXTENDED_NIST_TESTS + LATTICE_TESTS
```
- [ ] ENH: paranoid_crypto: add a __main__ so that python -m paranoid_crypto.randomness_tests calls eg:
- [ ] REF: examples/randomness.py -> lib/randomness_tests/main.py
- [ ] ENH: paranoid_crypto.randomness_tests: add a __main__ so that `python -m paranoid_crypto.randomness_tests -h` works
- [ ] ENH: setup.py: console_scripts entrypoint for examples/randomness_tests/main.py