Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Textual: a Python text user interface with Rich as the renderer (github.com/willmcgugan)
157 points by trueduke on June 17, 2021 | hide | past | favorite | 21 comments


I've been watching this evolve following Will on Twitter over the last few months - it's really exciting. I love how he's posting progress videos to the README too.

The underlying library Rich is some of the best API design I've seen in ages, so I have very high expectations of Textual which it looks like it's easily going to meet.


Cheers, Simon!


What about the API design is so awesome?


Mainly it's the absurd amount of functionality that's packed into the library, in a way that interoperates in a predictable way.

Rich does a LOT of stuff, and all of the things it does work with each other - so it's easy to compose them together into sophisticated combined layouts.

It can render Markdown in a way that works on a console. It has gorgeous progress bars and spinners built in. It has a very competent table layout mechanism.

https://github.com/willmcgugan/rich/tree/master/examples is full of neat examples of what it can do - all very Pythonic in the way they work.


This looks beautiful. I've already started using Rich in the REPL - it's definitely a nice little upgrade to get. The developer is very responsive and the project looks amazing.


Show HN for the base Rich renderer a year ago: https://news.ycombinator.com/item?id=23070821

It's an impressive piece of software with a few surprises. (such as rendering to HTML)


It's great to see some more competitors on the TUI front of the Python ecosystem! I recently tried multiple existing frameworks and was not particularly happy with the state.

Here are the main contenders for libraries that provide higher-level API than urwid/ncurses:

* Picotui, https://github.com/pfalcon/picotui

* Npyscreen, https://github.com/npcole/npyscreen

* py_cui, https://github.com/jwlodek/py_cui

Both Picotui and Npyscreen are relatively unmaintained / considered feature-full. py_cui seems to be in the best shape.

Fingers crossed for this project making it through, building on top of Rich gives it quite a bit of headstart. You can also sponsor @willmcgugan on Github [0].

[0]: https://github.com/sponsors/willmcgugan


Have you tried ASCIImatics? https://github.com/peterbrittain/asciimatics

A project I’m considering would have something similar to the Django admin interface but a TUI with keyboard shortcuts like shift+F9 and I’d like a “pick one and stick with it” recommendation for a TUI toolkit. That said, if a TUI front end for Django admin tasks already exists and I’ve missed it, I’d love to just use that rather than starting from scratch.


I did look into it, but its focus on animations gave me the perhaps unfair impression that the more mundane text UI elements (i.e. forms, etc.) would be a second-class citizen.

Looked like a really great library to build a text adventure game with though!


This looks great. If testing it works out, then using it will be very helpful for me. Thank you!


I'm a huge fan of Rich. Can't wait to add Textual to the toolbox.


My goal is to rewrite all our internal flask apps in this (or something similar)



I haven't done a TUI since using curses, which is appropriately named.

I do have some scripts used by non-developers, who can do things on the command line, but only by wrote. This would be really great for that vs having to build out a web-based thing.

This looks like DOS-based UIs, but so much nicer. I just never even considered that a possibility.

It looks like it's aiming for a very usable API, I'll try to follow its progress.


Reminds me of old DOS-based C++ editors I used way back in undergrad. Borland C++ being one of these. Except smoother/nicer looking.


I took a brief glance at the syntax. Am I correct in thinking this is SwiftUI-like?


SwiftUI, Jetpack Compose, Flutter are all very similar UI frameworks, based off of the declarative UI that React popularized.


SwiftUI is pretty clearly inspired by React, and as Will hinted in a sister comment, Rich is inspired by (I assume) React as well. So, I think the relationship is tangential rather than direct.


It might be. But I've never used SwitftUI. I'm taking inspiration from web technologies and various GUI systems I've used.


Ah, okay. As a sibling comment said SwiftUI was inspired by React so it makes sense that some concepts would transfer over. Thanks for the response!


Hope there's an equivalant framework for nodejs!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: