$npx skillfedfor your agent

random2

Python 3 compatible Python 2 `random` Module.

With conditionsPyPI Software DevelopmentReleased Dec 2023171.2K downloads / moPython 2.1.1Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — random2-1.0.2-py3-none-any.whl
v1.0.2 · released 2023-12-18

Yes, if you are porting Python 2 code to Python 3 and need deterministic random sequences to remain stable. No, if you are writing new Python 3 code—use the native random module instead. The package is dormant but stable, carries no known vulnerabilities, and has minimal friction. It solves a narrow, real problem for legacy code migration.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10, 3.11, 3.12, or 3.13; earlier Python 3 versions are not supported by version 1.0.2.
  • Low install friction with no runtime dependencies.
  • Dormant maintenance status (970 days since last release) but marked Production/Stable and updated to support Python 3.10, 3.11, 3.12, and 3.13 as of 2023-12-18.

License · maintenance · safety

Python 2.1.1 (permissive) — Licensed under Python Software Foundation License (permissive), imposing no significant restrictions on use or redistribution.

last release 2023-12-18 (970 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 171,150 downloads/mo, #10,379 on PyPI

Verify before relying

pip install random2

import random2
random2.seed(0)
print(random2.randint(1, 10))
  • Whether the Python 2.7 random algorithm implementation is mathematically identical to the original or only functionally equivalent for typical use cases.
  • Performance characteristics compared to Python 3's native random module.
  • Specific numeric output examples to verify seed reproducibility across Python versions.
Same gist for agents: .md · .json

What it is and what it does

Random2 is a backport of Python 2.7's random module to Python 3. It exists to solve a specific compatibility problem: Python 3 changed the implementation of randrange(), so even with an identical seed, Python 2 and Python 3 produce different random sequences. This breaks reproducibility in test suites and other code that depends on stable, predictable random output across Python versions.

The package provides a drop-in replacement that generates the same sequence as Python 2.7 when given the same seed. It has no external dependencies and installs as a pure Python wheel. It is most useful for porting legacy test code or simulations from Python 2 to Python 3 without having to rewrite all the expected random outputs.

Use it for

  • Porting Python 2 test suites to Python 3 while keeping random-number expectations unchanged.
  • Running stochastic simulations or Monte Carlo code that was originally written for Python 2 and requires identical results.
  • Comparing random-number behavior between Python 2 and Python 3 implementations of the same algorithm.
  • Reproducing historical results from Python 2 code that relied on specific random sequences.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are porting Python 2 code to Python 3 and need deterministic random sequences to remain stable.

No, if you are writing new Python 3 code—use the native random module instead. The package is dormant but stable, carries no known vulnerabilities, and has minimal friction. It solves a narrow, real problem for legacy code migration.

Install

random2 on PyPI

Before you install

Low install friction with no runtime dependencies. Dormant maintenance status (970 days since last release) but marked Production/Stable and updated to support Python 3.10, 3.11, 3.12, and 3.13 as of 2023-12-18.

Requires Python 3.10, 3.11, 3.12, or 3.13; earlier Python 3 versions are not supported by version 1.0.2.

License in practice

Licensed under Python Software Foundation License (permissive), imposing no significant restrictions on use or redistribution.

Quickstart

pip install random2

import random2
random2.seed(0)
print(random2.randint(1, 10))

Verify before relying

  • Whether the Python 2.7 random algorithm implementation is mathematically identical to the original or only functionally equivalent for typical use cases.
  • Performance characteristics compared to Python 3's native random module.
  • Specific numeric output examples to verify seed reproducibility across Python versions.

Package facts

LicensePython 2.1.1 permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceDormant 970 days since the last release
First released
Downloads171,150 / month, #10,379 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: Implementation :: CPython

Evidence: random2-1.0.2-py3-none-any.whl

Tags

Capabilities
python 2 random module python 3reproducible random sequences cross-versionpython 2.7 random compatibilitystable random generator resultsrandrange python 2 behaviorseed-stable random numberspython version random compatibility
Topics
python-2-compatreproducibilitytesting
PyPI keywords
roman

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “python 2 random module python 3”

  • random2Provides Python 2.7's random module implementation for Python 3,…
  • rstrGenerates random strings from custom alphabets, predefined character…
  • exrexExrex generates all or random strings matching a given regular…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also pytest-rng · random-slugs · pytest-randomly · pytorch-seed · haikunator · pytest-random-order · backports.csv · random-address · dict-hash · pyudorandom