meta.decompile - decompile code objects into ast nodes

Decompiler module.

This module can decompile arbitrary code objects into a python ast.


Decompile a function into ast.FunctionDef node.

Parameters:func – python function (can not be a built-in)
Returns:ast.FunctionDef instance.
meta.decompiler.compile_func(ast_node, filename, globals, **defaults)[source]

Compile a function from an ast.FunctionDef instance.

  • ast_node – ast.FunctionDef instance
  • filename – path where function source can be found.
  • globals – will be used as func_globals

A python function object

meta.decompiler.decompile_pyc(bin_pyc, output=<open file '<stdout>', mode 'w' at 0x7ff30e6b4150>)[source]

decompile apython pyc or pyo binary file.

  • bin_pyc – input file objects
  • output – output file objects