uncompyle6
Python cross-version byte-code decompiler
What it is and what it does
uncompyle6 is a Python bytecode decompiler that reconstructs source code from compiled .pyc and .pyo files. It spans Python versions 1.0 through 3.8 and PyPy bytecodes, making it one of the few tools that handles such a wide historical range. Unlike simpler decompilers, it builds a parse tree using compiler technology to understand bytecode structure deeply, allowing it to deparse not just complete files but also code fragments at specific bytecode offsets—useful for runtime debugging and stack trace enhancement.
The tool depends on click for CLI handling, spark-parser for parsing, and xdis for bytecode analysis. It is actively maintained and has no known security vulnerabilities. The GPLv3 license means any derivative work must remain open-source. It is most useful when you have only compiled bytecode and need to recover or understand the original source, or when you need to inspect bytecode fragments at runtime for debugging purposes.
Use it for:
- Recover source code from legacy .pyc files when original source is lost or unavailable.
- Analyze and understand obfuscated or compiled Python bytecode for security auditing.
- Extract code fragments at specific bytecode offsets for enhanced stack traces in debuggers.
- Verify decompilation correctness by comparing bytecode across Python versions.
- Inspect PyPy bytecode or bytecode from Python 1.x–2.7 when other tools only support modern versions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
uncompyle6 translates Python bytecode back into equivalent Python source code, supporting Python versions from 1.0 through 3.8 and PyPy bytecodes.
Yes, if you need to decompile Python bytecode. uncompyle6 is actively maintained, has no security vulnerabilities, and offers the broadest Python version support (1.0–3.8 + PyPy) among available decompilers. The GPLv3 license is a hard constraint for proprietary use; open-source projects face no barrier. Install friction is low. Decompilation quality varies by Python version (strongest around 3.3–3.4, weaker at the extremes), so verify output for your target bytecode version.
Install
uncompyle6 on PyPI
pip
pip install uncompyle6uv
uv add uncompyle6poetry
poetry add uncompyle6Installing uncompyle6
Before you install
Low install friction with pure-Python wheels for multiple Python versions (3.6–3.9). Actively maintained as of 2026-04-24 with 4317 repository stars and no known security vulnerabilities.
License in practice
GPLv3 copyleft license: any derivative work or distribution must also be open-source under GPLv3. Suitable for open-source projects; proprietary applications cannot incorporate this code without licensing compliance.
Quickstart
pip install uncompyle6
uncompyle6 compiled-python-file.pyc
Requires a .pyc or .pyo file as input; bytecode must originate from a Python version the tool recognizes (1.0–3.8 or PyPy).
Verify before relying
- Exact Python version requirements for running uncompyle6 itself (description mentions git branches but not minimum runtime version).
- Whether fragment deparsing and runtime bytecode offset association are accessible via public API or CLI.
- Decompilation accuracy rates for specific Python versions beyond 3.8.
Package facts
| License | GPL3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — click, spark-parser, xdis |
| Maintenance | actively maintained — 319 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 494,456/month — #6,349 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uncompyle6-3.9.3-py36-none-any.whl; uncompyle6-3.9.3-py38-none-any.whl; uncompyle6-3.9.3-py39-none-any.whl; uncompyle6-3.9.3-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
decompyle3Decompyle3 translates Python bytecode back into…
copyleft · top 15,000 on PyPI
pycleanRemoves Python bytecode files (.pyc) and…
copyleft · top 15,000 on PyPI
pycnitePycnite provides pure Python parsers for Python…
permissive · top 5,000 on PyPI
bytecodebytecode generates and modifies Python bytecode…
permissive · top 1,000 on PyPI
xdisDisassembles Python bytecode from any Python…
copyleft · top 15,000 on PyPI
pyc-wheelCompiles all Python source files (.py) in a…
permissive · top 15,000 on PyPI
depyfDecompile and inspect the internal bytecode and…
permissive · top 5,000 on PyPI
ast-decompilerConverts Python abstract syntax trees (ASTs)…
permissive · top 15,000 on PyPI
ethereum-dasmDisassembles Ethereum EVM bytecode into…
copyleft · top 15,000 on PyPI
python-minifierTransforms Python source code into compact,…
permissive · top 15,000 on PyPI