Cross platform library to build command line user experiences.
Python is cross platform, so why shouldn't the tools that interact with the command line also be? Intermezzo provides a simple API to create terminal based user experiences. It takes the ergonomics of Python and combines it with the cross platform flexibility of Golang. Intermezzo is a thin wrapper around the simple, but powerful Termbox(-Go) library--which is a modern replacement for curses/blessings and pypiwin32
Curses/Blessings only works on Linux and BSD terminals. On Windows, there is little to no support/documentation is hard to grok. Additionally, there was nothing that kept the API consistent across both platforms. (Believe me, I've checked) Of course, there are specialized libraries out there like Colorama and Python Prompt Toolkit, but I felt they were overly complex and/or niche.
When I came across Peter Brittain's asciimatics, it was incredibly straight forward and intuitive. I wanted something similar to what he did with screen.py, but without all the other bells and whistles and fancy effects of the library. Then I came across termbox and, more recently, termbox-go. There is a proliferation of projects already built on top of termbox-go. The problem? Well...for most CLI applications, Go might be a bit overkill. How could we optimize for developer speed and productivity? (eg. with Python, Ruby, Node, etc) With Go 1.5+, go build
allows for the building of shared C libraries that could be interfaced through FFI. This means that in theory, termbox-go could be ported to any language that has solid FFI with C.
Here is the Python version using CFFI. (feel free to use this as a reference)
TDB.
- Have got to thank the amazing nsf for providing an excellent library for working with command line interfaces.
- Many thanks to peterbrittain for the initial iteration of Intermezzo based on his screen.py implementation.
- Couldn't have done it without this guide written by Andrey Petrov (shazow): See Python, See Python Go, Go Python Go as well as the guide by Filippo Valsorda: Building Python Modules with Go 1.5
Copywrite (c) 2016-2017 David Ho. Licensed under the MIT license.