KIG is free and open-source interactive geometry software, which is part of the KDE Education Project. It has some facilities for scripting in Python, as well as the creating macros from existing constructions.