ast2code(ast_node[, indent, line_length])

Decompiles an AST into Python code.

Code Tools


code_lines_to_func(lines, func_name, ...[, ...])

get_identifiers(expr[, include_numbers])

Return all the identifiers in a given string expr, that is everything that matches a programming language variable like expression, which is here implemented as the regexp \b[A-Za-z_][A-Za-z0-9_]*\b.

indent(text[, num_tabs, spaces_per_tab, tab])

deindent(text[, num_tabs, spaces_per_tab, ...])

word_replace(expr, substitutions[, exclude_dot])

Applies a dict of word substitutions.


Check whether the function is a lambda function.

get_main_code(func[, codes])

Get the main function _code string.


change_func_name(f, name)

New Dict

DictPlus(*args, **kwargs)

Python dictionaries with advanced dot notation access.

class*args, **kwargs)[source]

Python dictionaries with advanced dot notation access.

For example:

>>> d = DictPlus({'a': 10, 'b': 20})
>>> d.a
>>> d['a']
>>> d.c  # this will raise a KeyError
KeyError: 'c'
>>> d.c = 30  # but you can assign a value to a non-existing item
>>> d.c
copy() a shallow copy of D[source]
setdefault(key, default=None)[source]

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

Name Checking

check_name(name, obj)


Other Tools