The Command class is a subclass of Macro. This is the class that should be subclassed when creating Python based macros that correspond to LaTeX commands.
For more information on the Command class’ API, see the Macro class.
plasTeX 2.0 — A Python Framework for Processing LaTeX Documents