moddedBear

First Look at Textual

I've found that sometimes it's a good idea to learn something completely new and unfamiliar to avoid getting burned out on any one project or task. My latest go at that was learning Textual, a Python framework for building text user interfaces (TUIs).

Textual on GitHub

I haven't gotten super familiar with all aspects of Textual so far, but I have managed to make a very basic TUI app for logging in and posting to Mastodon.

Textual left a positive first impression on me. If you've ever worked on a web app using Vue or a similar javascript framework, Textual feels very similar where you're quickly building widgets then piecing them together alongside the code and styling them with CSS. It might feel overkill for a TUI but as a result, UIs built with Textual are really rich and highly interactive. Just go check out some of their official examples on GitHub or projects other people have made if you don't believe me.

It was pretty easy to follow along with the examples and get my own simple app built. Where I struggled a bit was finding out the best way to use Textual in a larger project with multiple screens each with widget hierarchies that go a couple layers deep. Official documentation and examples are decent but naturally are a bit simplistic, and it's difficult to find documentation outside of that. I guess that's fair considering Textual is relatively new and niche.

Will McGugan - Introducing Textual (June 2021)

I may come back to this Mastodon TUI idea in the future if I get some time, but for now it was just satisfying learning a new tool and building a fairly nice looking TUI with no boilerplate -- especially having had no prior experience building a TUI.

- moddedBear / 2022-11-29

Home