MacTerm allows Python programming using APIs called Quills.

Although the API is currently quite small, it is already extremely powerful.  It is primarily callback-based, allowing you to “plug in” customizations to key parts of the program.

There are two approaches to customization:

Basic Scripting Using a Customization Module

Advanced Topics

Quills APIs

You can use the pydoc program to read documentation on Quills modules, as long as all necessary Python and C++ library paths are set in the environment.  Similarly, in an interactive Python shell where Quills is loaded, you can use the help() function.