--- id: legacy-cgi version: "2.6.4" license: PSF-2.0 license_treatment: permissive maintenance: aging --- # legacy-cgi — Fork of the standard library cgi and cgitb modules removed in Python 3.13 License: permissive · Maintenance: aging · Downloads: 6.2M/mo ## What it is and what it does legacy-cgi is a fork of Python's cgi and cgitb modules that were removed from the standard library in Python 3.13 per PEP-594. It restores those modules for projects that still depend on them, allowing CGI scripts written for Python 3.12 and earlier to run unchanged on newer Python versions. The package has no runtime dependencies and is designed purely for compatibility—the author explicitly recommends that new applications use ASGI or WSGI frameworks instead. It is most useful as a conditional dependency for legacy codebases that cannot immediately migrate away from CGI. Use it for: - Running existing CGI scripts on Python 3.13+ without rewriting them to use modern web frameworks. - Maintaining backward compatibility in projects that still use cgi.FieldStorage or cgitb for error handling. - Gradual migration of legacy systems by keeping old CGI code functional while planning a transition to ASGI or WSGI. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the cgi and cgitb modules removed from Python 3.13's standard library, allowing existing CGI scripts to run on newer Python versions without modification. Yes, if you have code that depends on cgi or cgitb and cannot immediately refactor to ASGI or WSGI. Install it conditionally to avoid unnecessary overhead on older Python versions. No security vulnerabilities are known. Not recommended for new projects. ## Install pip install legacy-cgi uv add legacy-cgi poetry add legacy-cgi ## Installing legacy-cgi Before you install: Low install friction with no runtime dependencies. Maintenance status is aging—last commit was 2025-10-27—but the package remains active. Suitable for projects that need backward compatibility with removed stdlib modules. License in practice: Licensed under PSF-2.0 (permissive), the same license as Python itself. No restrictions on use or redistribution in typical projects. Quickstart: pip install legacy-cgi import cgi form = cgi.FieldStorage() Intended for Python 3.13+; on earlier versions the built-in stdlib modules take precedence, making this package unnecessary. Verify before relying: - Whether the package handles all edge cases that arose during stdlib removal in Python 3.13. - Performance characteristics compared to modern ASGI/WSGI alternatives for production deployments. - Full compatibility scope with all cgi and cgitb use patterns from Python 3.12 and earlier. ## Package facts - License: PSF-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 6.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cgi module python 3.13, legacy cgi support, cgitb error handling, python cgi fork, standard library cgi replacement, cgi script compatibility, legacy-support, cgi-compatibility [View on SkillFed](https://skillfed.io/packages/legacy-cgi) · [View on PyPI](https://pypi.org/project/legacy-cgi/)