DrawBot is a simple application for macOS that lets you write Python scripts which generate 2D graphics:
DrawBot screenshot