@zacbir made a canvas type module that was cross platform
Examples are here (though looks like he later renamed geometer to geometriq, you you might need to change the imports)
I believe this worked with pythonista, MacOS Cairo, maybe pillow and a few others. You'll have to look at what backends you have available on your platform. I think he has some minimal support for svg, but not sure.
This is a similar canvas type idea, geared towards animation. You can use the Khan framework for creating your own projects from scratch (you don't have to just do the lessons)