Skip to main content

A Python 2.7 byte-code decompiler, written in Python 2.7

Version 0.13, 2012-2-22

Introduction

Note: this package is not likely to change, and has been largely superseded by: uncompyle6

uncompyle2 converts Python byte-code back into equivalent Python source. It accepts byte-code from CPython version 2.7 and runs on Python 2.7 only.

The generated source pretty prints docstrings, lists, tuples and hashes.

uncompyle2 may also verify the equivalence of the generated source by by compiling it and comparing both byte-codes.

This code is based on John Aycock’s generic small languages compiler spark and his prior work on a tool called decompyle. It was vastly improved by Hartmut Goebel.

Features

  • decompiles Python byte-code into equivalent Python source

  • pretty-prints docstrings, hashes, lists and tuples

  • reads directly from .pyc/.pyo files, bulk-decompile whole directories

  • output may be written to file, a directory or to stdout

  • option for including byte-code disassembly into generated source

Usage

uncompyle2 -h       # prints short usage
uncompyle2 --help   # prints long usage

Known Bugs/Restrictions

Runs on Python 2.7 only and handles bytecodes from 2.5-2.7. For something that runs on Python 2.6, 2.7, 3.2. 3.3, 3.4 and 3.5 and handles bytecodes from 2.5-3.5, see uncompyle6.

See Also

Metadata

Release files for uncompyle2 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uncompyle2 1.1
File Size Uploaded
uncompyle2-1.1.tar.gz 351.2 kB Details

Release files / uncompyle2-1.1.tar.gz

Download URL uncompyle2-1.1.tar.gz
Size 351.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ff7323807493ceab214fc03f783d31a5abeec6e2e0add75694c10bf542a111fc
BLAKE2b-256 checksum
How to use checksums
63b41aca60bc9255c63b4faef8dd6b78dab6851d75684728f6718c49f7ed777d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.0.0

2 release files

This release

1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page