Skip to content

idlesign/pytakeout

Repository files navigation

pytakeout

https://github.com/idlesign/pytakeout

LBC Python 2

release lic ci coverage health

Description

Simplifies Python code extraction

With this you can easily:

  • extract function/method/class source code;
  • perform basic code transformations;
  • save code into a file.

Sample

from pytakeout import extract_code, code_to_file


def func_to_extract():
    # This function needs to be extracted.
    return True


# Extract code as a string.
code = extract_code(func_to_extract)

# Save it into a temporary file.
tmp_code_file = code_to_file(code)