Lost Your Python Source? -- Get it back!

Lost your Python source files? But still have the .pyc/.pyo files? Get your sources back! Just send in your .pyc/.pyo file and get the source code mailed back to you within hours!

The 'decompyle' service converts Python byte-code back into equivalent Python source. It accepts byte-code from any Python version starting with 1.5 up to 2.5

The generated source is very readable: docstrings, lists, tuples and hashes get pretty-printed. Only the comments are missing. To ensure the source code is correct, we verify the equivalence of the generated source by compiling it and comparing both byte-codes.

Yes, I want to get my source code back!

News

  • Now supports Python 2.5!
  • Need to decompyle a py2exe file? Ask us!
  • You don't need to hassle with installing 'decompyle': We are now offering an online service for 'decompylation'. This is very helpfull since you propably need 'decompyle' only once.
  • We did a major internal redesign to be prepared for further enhancements and changes to the Python core.

Features

  • decompyles Python byte-code into equivalent Python source
  • decompyles byte-code from Python versions 1.5 up to 2.5
  • pretty-prints docstrings, hashes, lists and tuples
  • only the comments are missing
  • we verify wether the generated source is correct (not for personal service)

How good is decompyle?

  • See the examples section for examples.
  • Our unit-tests include about 2850 test-patterns. Each of it is successfully decompiled for all supported versions, both normal (.pyc) and optimized (.pyo) bytecode. This is a total of 45100 test-cases.
  • decompyles and successfully verifies 100% of the Python 1.5, 2.0, 2.1, 2.2, 2.3, 2.4 and 2.5 library
  • decompyles and successfully verifies 100% of the Python 1.5 library, including lib-stdwin, lib-tk, gnome and gtk.
  • To quote some honourable Phthon developer: "Your tool is awefull: The resulting source is even better than the original one!"

Yes, I want to use this service!

Limitations and Known Bugs

  • The EXTENDED_ARG token is untested (this is a new token for Python 2.0 which is used only if many items exist within a code object).

Acknowledgement

'decompyle' uses John Aycock's generic small languages compiler 'spark' and his prior work on decompyle.


© Copyright 2004 · Hartmut Goebel, 09/03/04