--- id: xdis version: "6.3.0" license: GPL-2.0 license_treatment: copyleft maintenance: active --- # xdis — Python cross-version byte-code disassembler and marshal routines License: copyleft · Maintenance: active · Downloads: 662.0K/mo ## What it is and what it does xdis is a cross-version Python bytecode disassembler and manipulation library. The standard Python dis module only works on bytecode from the same Python version you are running; xdis removes that constraint, allowing you to inspect, analyze, and disassemble bytecode from any Python version on any other Python version. It can marshal-load bytecode, translate between Python version numbers and magic values, unpack and repack code objects, and provide advanced disassembly output in multiple formats. The package is useful for reverse-engineering, bytecode analysis, writing cross-version assemblers or optimizers, and understanding how Python compiles code across different language versions. It has no runtime dependencies and is available as pure-Python wheels for most Python versions, though installation on Python versions before 3.11 requires downloading version-specific distributions from GitHub rather than PyPI. Use it for: - Reverse-engineer or audit Python bytecode from a different Python version than your development environment. - Write a bytecode-level optimizer or analyzer that works across multiple Python versions. - Translate between Python version numbers and their corresponding bytecode magic values for tooling or documentation. - Inspect and modify code objects programmatically, such as rewriting constants or instruction sequences. - Build a cross-version Python decompiler or bytecode assembler. - Debug or analyze compiled Python code from production systems running a different Python version. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Disassembles Python bytecode from any Python version (1.0 through 3.13) regardless of which Python version you are running, and provides utilities for bytecode manipulation, magic-number translation, and code object introspection. Yes, if you need to work with Python bytecode from versions other than the one you are running. The package is actively maintained, has no dependencies, and carries low install friction on modern Python. The GPL-2.0 copyleft license is a significant constraint for proprietary or closed-source use; evaluate your distribution model before adopting. For Python 3.11+, installation is straightforward; for older versions, the GitHub-only distribution model adds friction but is workable. ## Install pip install xdis uv add xdis poetry add xdis ## Installing xdis Before you install: Low install friction with pure-Python wheels available for Python 2 through 3.13. Actively maintained with a recent release. For Python 3.11+, standard pip install works; older versions require downloading version-specific wheels or tarballs from GitHub Releases rather than PyPI. License in practice: Licensed under GPL-2.0 (copyleft). Use in proprietary software requires either distributing source code or obtaining a different license; linking or bundling this library into closed-source projects carries copyleft obligations. Quickstart: pip install xdis import xdis.disassemble import xdis.magics # Disassemble bytecode from a different Python version with open('some_bytecode.pyc', 'rb') as f: xdis.disassemble.disassemble_file(f) For Python versions before 3.11, you must download and install the version-specific wheel or tarball from GitHub Releases; standard PyPI pip install only works on Python 3.11+. Verify before relying: - Whether the package can actually read and disassemble bytecode from Python 1.0 (the description claims support back to 1.0, but this may be aspirational or historical). - Whether the 'extended' and 'extended-format' disassembly modes truly produce expression trees as claimed, or if this is limited to certain Python versions. - Performance characteristics when processing large bytecode files or many files in sequence. ## Package facts - License: GPL-2.0 (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 662.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cross-version python bytecode disassembler, python bytecode analysis, marshal load bytecode, python magic number conversion, bytecode decompilation tool, python code object inspection, wordcode disassembly, bytecode-analysis, reverse-engineering, cross-version-compatibility [View on SkillFed](https://skillfed.io/packages/xdis) · [View on PyPI](https://pypi.org/project/xdis/)