Python 2.7 decompiler
Clone or download
Pull request Compare This branch is 11 commits ahead, 59 commits behind gstarnberger:master.
Latest commit b222c57 Jul 24, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts add --deob Mar 13, 2013
test Update original authors URL. Nov 16, 2012
uncompyle2 Fix for issue 43 Jul 24, 2018 first real commit Jan 5, 2011
PKG-INFO Update PKG-INFO Jul 16, 2018
README Fix typos in README Dec 17, 2013
compile_tests first real commit Jan 5, 2011
setup.cfg Updating original authors email-address. Nov 16, 2012 Fixed repository URL Aug 19, 2015
test_one first real commit Jan 5, 2011
test_pythonlib first real commit Jan 5, 2011


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


'uncompyle2' converts Python byte-code back into equivalent Python
source. It accepts byte-code from Python version 2.7 only. Additionally,
it will only run on Python 2.7.

The generated source is very readable: docstrings, lists, tuples and
hashes get pretty-printed.

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

'uncompyle2' is based on John Aycock's generic small languages compiler
'spark' ( and his prior work on
a tool called 'decompyle'. This tool has been vastly improved by
Hartmut Goebel ``_

Additional note (3 July 2004, Ben Burton):

    This software is no longer available from the original website. It
    has now become a commercial decompilation service, with no
    software available for download.

    Any developers seeking to make alterations or enhancements to this code
    should therefore consider these debian packages an appropriate starting


  * decompiles Python byte-code into equivalent Python source

  * decompiles byte-code from Python version 2.7

  * pretty-prints docstrings, hashes, lists and tuples
  * reads directly from .pyc/.pyo files, bulk-decompile whole

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

  * option for including byte-code disassembly into generated source

  For a list of changes please refer to the 'CHANGES' file.


uncompyle2 requires Python 2.7


You may either create a RPM and install this, or install directly from
the source distribution.

Creating RPMS:

  python bdist_rpm

  If you need to force the python interpreter to eg. python2:
     python2 bdist_rpm --python=python2

Installation from the source distribution:

     python install

   To install to a user's home-dir:
     python install --home=<dir>

   To install to another prefix (eg. /usr/local)
     python install --prefix=/usr/local

  If you need to force the python interpreter to eg. python2:
     python2 install

  For more information on 'Installing Python Modules' please refer to


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

Known Bugs/Restrictions