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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uncompyle2-1.1.tar.gz (351.2 kB view details)

Uploaded Source

File details

Details for the file uncompyle2-1.1.tar.gz.

File metadata

  • Download URL: uncompyle2-1.1.tar.gz
  • Upload date:
  • Size: 351.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uncompyle2-1.1.tar.gz
Algorithm Hash digest
SHA256 ff7323807493ceab214fc03f783d31a5abeec6e2e0add75694c10bf542a111fc
MD5 0264f4c95ffabb0dc4e86b66ecc685d3
BLAKE2b-256 63b41aca60bc9255c63b4faef8dd6b78dab6851d75684728f6718c49f7ed777d

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.0

2 files

This release

1.1 This release

1 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