ArtSI

ArtSI is a python module for drawing in the terminal using ANSI escape codes. Tools: Python, uv, PyPI, Twine, Hatch

After teaching some intro programming classes in pure Python and watching how quickly the students get bored of printing text to a terminal, my co-teachers and I started making programs to draw in the terminal using ANSI escape codes, both to pitch for curriculum, and for fun ofc. ArtSI is the hat I threw into that metaphorical ring, and I was also able to use it as an excuse to finally learn how to package and publish a python module!

Source is here if you are interested.

How Does ArtSI Work? #

ArtSI is designed around the idea of a Canvas which is a grid of characters and another of escape codes for those characters.

Technically it is implemented in such a way that you can change the printed characters to whatever you like but I never really used that in example projects so the methods were removed. They are spaces by default but the bones remain to change them.

You can change the color of cells by drawing rectangles at their position and it updates their colors in memory. Once you call the show() method on the Canvas class it will redraw everything onto the terminal and clear the buffer. This works well enough for small programs which is all it was built for.

I made a few games with this program and might revisit it later.
The main point of this project for me was learning how to put it on PyPI so here is how I did that.