The CodeTools project provide a series of modules for analysis and control of code execution. The key components are Blocks, sections of code to execute, and Contexts, dictionary-like objects which are used as namespaces for Block execution. CodeTools is designed to perform such tasks as:
CodeTools depends upon Traits, with an optional dependency on SciMath and Numpy for unit support, but has no major dependencies beyond that.
CodeTools is under active development, so the implementation and API are somewhat fluid.