9 ms·
Textual: Rapid Application Development framework for Python
- darkstar999 3y agoI tried this a while back but was put off by the fake "css". They say "The dialect of CSS used in Textual is greatly simplified over web based CSS and much easier to learn." But I immediately ran into issues trying to use css that I'm familiar with (and it wasn’t even fancy). They should have called it something else and used different syntax.
- deleted 3y ago[deleted]
- mappu 3y agoGtk and Qt both fell into this uncanny-valley too - QStyleSheet is very limited compared to browser CSS.
- ye-olde-sysrq 3y agoThis looks really cool. In the past I used lanterna (https://github.com/mabe02/lanterna/tree/master https://github.com/mabe02/lanterna/tree/master) to develop a text UI for a critical process at the trading firm I worked at. It was essentially a process that would take updated market data and handle things that changed between the last trading session and today - like symbol renames (PCLN to BKNG), changes to market cap that make it change what "category" it fell into (they were based on market cap and volatility measures etc). Things of that nature, that the realtime system didn't handle but happened too often or were too hairy for us to just handle manually. The system had a desktop UI component that was oriented towards use by our trading staff. We didn't really have notion of a "server UI" and the server was headless. Nobody at our firm was a frontend developer, just backend, systems and data programmers who occasionally dabbled in frontend. So web UIs were very simplistic or highly specific to their use-case, we had no shared tooling. In 2023 with things like create-react-app and whatever next.js does, I probably would've opted for one of those. I could've made another desktop app but I wanted to be able to easily get to this from a shitty ssh connection over tethered 4g when I was on-call. So X11 forwarding and RDP were out. So i looked around for a TUI-builder in the project's language, Java. What i really liked about Lanterna was that it had a Swing-based implementation which meant I could easily run it from IntelliJ, and that would let me iterate rapidly, and then in production I could run it in a terminal via SSH directly on the machine the server was on (which had certain advantages). I'll keep an eye on this to see if I can think of anything neat to build on it. I still generally don't like web apps because they feel like they take a lot of effort to get something compared to a functionally-equivalent product built in something non-browser-based like a TUI or desktop GUI.
- zokier 3y agoI know textualize/rich are HN darling projects, but do we really want full-color mouse driven gui applications full with superfluous animations in our terminals?
- misnome 3y agoWe? No. Me? No. Some people? Sure? I've been using textual a couple of months for live-system-analysis GUI and while the big flashy things with animation/mouse/gigantic whitespace borders are what they show off, you don't have to use any of that; It does take a lot of the complexity out of bigger-than-screen/scrollable windows/mouse interaction/layout details away. It also has a nice selection of Widgets, including the DataTable, which either works for you, or works as an example of how to build things.
- deleted 3y ago[deleted]
- marcodiego 3y agoMaybe I got spoiled from the time I used to play with delphi, but for me RAD screams a good UI builder built in.
- deleted 3y ago[deleted]
- JonathanBeuys 3y agoAfter a few decades of developing applications, I am convinced that frameworks are the wrong approach. You gain development speed in the beginning, but you lose it later on when the framework introduces breaking changes and you have to keep working around a changing stack. Or the framework gets abandoned and it would be too much work to maintain it. Because it has so much bells and whistles you don't need. This one for example contains 1298 files without dependencies. Both, coding everything yourself or using lean libraries are better. There are very few lean libraries unfortunately. Keeping code elegant and simple is a rare skill. When there is a lean, well done library for my use case, I use it. Because if shit hits the fan, I can maintain the library myself.
- anonzzzies 3y ago> There are very few lean libraries unfortunately. Keeping code elegant and simple is a rare skill. So... You are saying 'you should write everything yourself with libraries that basically don't exist'? I agree with you somewhat, but it's not very realistic; it's so much faster to use something that gets you 80% of the way with minimum work. And you know it'll break in a bit but that's life. Also, frameworks like Django or ASP.NET have been pretty stable for a very long time. We have large Django projects from 10 years and updating those was a breeze.
- TekMol 3y agoit's not very realistic It is totally realistic. I have multiple projects running that do not use any external code. With millions of users. Those projects are PHP though. PHP has a lot of bells and whistles on board. Unfortunately with PHP 8, they started introducing a lot of breaking changes. So they lost my trust and I will use Python for new projects. Not sure yet if I will use Django (As you said, it seems pretty stable) or do the good old CGI approach. If I do the latter, I will probably write a new CGI library for it, because in the Python ecosystem it is all about long running processes nowadays and I think that is the wrong approach.
- VectorLock 3y ago
- simonw 3y agoMy favourite Textual demo at the moment is this one: https://github.com/1j01/textual-paint https://github.com/1j01/textual-paint It's a very decent Microsoft Paint imitation that runs in your terminal!
- LispSporks22 3y agoRapid application development is probably the wrong description. That’s already used by systems that have UI builders and code integrated, like Delphi etc and early systems like VB. I went looking for such a thing in this project and only found examples in Python scripts.
- deleted 3y ago[deleted]
- Timothycquinn 3y agoThis looks great. I just finished an internal devops and change control app using unicurses and python and although it works, it will not scale well. Initially, I tried doing TK and QT but they both have their quirks with initial installation. My experience with QT is that its works well but useful documentation is sparse. I'll definitely be giving textual a try as it fits my requirement space perfectly.
- jdoss 3y agoI am working on a new python project and one of the first things I added was https://github.com/Textualize/rich https://github.com/Textualize/rich because of how easy it is to make things look good in the terminal.
- benrutter 3y agoI love building command line tools and as much as I like the look of Textual I've tried it a few times and it's a little too heavy/inflexible for me. Rich on the other hand is immense and I makes development so smooth- it's great to be able to have a nice api for bold/color/emoji/tables etc straight out the box!
- barrotes 3y agoThis is simply beautiful
- avinassh 3y agothis looks very beautiful, are there any similar libraries in Go/Rust?
- dinkleberg 3y agoI haven’t used textual so I’m not sure if these are exactly the same type of thing, but for Go clis it is worth checking out the libraries that the folks at https://charm.sh/ https://charm.sh/ have created.
- benrutter 3y agoConsole might be close to what you're looking for[1] if you want to do things like colour printing etc 1. https://github.com/console-rs/console https://github.com/console-rs/console
- theanonymousone 3y agoI'm still waiting for the VSCode for Terminal
- PurpleRamen 3y agoLike Emacs, running in a terminal? Or more like tmux, managing terminals?
- theanonymousone 3y agoWhichever has the best IntelliSense/LSP support for the top 5 TIOBE languages:)
- passion__desire 3y agocustomize neovim ??
- theanonymousone 3y agoNever succeeded in getting it to work. Maybe should try harder? Is there a Docker image with everything in place?
- baq 3y agotry this one https://spacevim.org/quick-start-guide/#run-in-docker https://spacevim.org/quick-start-guide/#run-in-docker personally haven't... but it just might work.
- sureglymop 3y agoLunarvim
- deleted 3y ago[deleted]
- weebull 3y agoEmacs 29 then
- aa1234556 3y ago[dead]
- tomhallett 3y agoThis looks very cool. For the web browser version which is coming soon, will the “DirectoryTree” feature be supported? Any idea when the web view will be in beta/launch?
- billowycoat 3y agoAll widgets will be supported. Web version will be going in to Beta in a few weeks.
- tomhallett 3y agoAwesome! I'm imagining a workflow where textual can be used as a progressive enhancement for a cli tool, in case the user doesn't pass in all required flags. A web frontend for that view will make it more comfortable for even more types of users.... :) python code_format.py --file app.js => textual isn't used/invoked at all python code_format.py => textual is used to show user a DirectoryTree file dialog, then exits I'm assuming this could work via "App" return values: app.exit({ file: "app.js" }) Do you have any examples of textual being used in this manner? If not, no worries
- ramses0 3y agoDid a cursory dive through, check: https://textual.textualize.io/tutorial/ https://textual.textualize.io/tutorial/ and https://github.com/Textualize/textual/blob/main/docs/examples/tutorial/stopwatch.py https://github.com/Textualize/textual/blob/main/docs/example... ...what have people had success with in golang-world? Anything reasonably equivalent someone could recommend? There's a fair amount of "stuff" for TUI's in golang, the thing that's very attractive about 'textualize' is it feels very "web-browser-y" and has a nice (scrollable!) table view. `tview` seems interesting (eg: check `brew install dbui`), but feels a bit more like _you're_ doing all the imperative `if KeyPress.A: do_something()` instead of declarative, nesting navigation, etc. (perhaps that's the difference between an "application-centric/SPA" view of "control all the things!" vs. a document centric: "add components to a page and let them flow"). Any feedback on the items in this list? https://codeberg.org/tecras/awesome-go#advanced-console-uis https://codeberg.org/tecras/awesome-go#advanced-console-uis
- nottorp 3y ago> _you're_ doing all the imperative `if KeyPress.A: do_something()` instead of declarative, You mean they don't hide the message loop as is in fashion and actually let you control it?
- ramses0 3y agoMore like the generally accepted concepts of "selected, active, focus, style, change", and declaring either a visual response or "onEvent" response. A nested hierarchy, components may be complicated internally but expose a simple input and output interface. And yes, something a little more high level than `if key == 'a'` means you're focusing more on the data and display rather than the method. Different abstractions for different use cases, I guess. Any recommendations?
- memefrog 3y agoComputing is broader than the web.
- regularfry 3y ago
- DiggyJohnson 3y agoI would love to find a way to get some sort of emulation layer to get Textual apps running in the browser. Does anyone know of any projects that might aid in this silly goal?
- billowycoat 3y agoThat’s pretty much what Textual is going. We will be beta testing soon.
- qbasic_forever 3y agoJust run a web terminal like ttyd: https://tsl0922.github.io/ttyd https://tsl0922.github.io/ttyd
- tusharsadhwani 3y agothey're beta testing `textual-serve` which does exactly this.
- zerr 3y agoAre these animations and transitions done purely in ASCII text?
- billowycoat 3y agoWell Unicode text. But yes, it’s all text.
- ramses0 3y agoYep, they made the terminal feel slow! /s But seriously, check out their "easing" and transition stuff. The 500ms "lag" is annoying for power users, but does help provide context while learning an app's navigation I guess?
- friend_and_foe 3y agoI was looking for a python graphical interface library and came across this, I came to the conclusion that it is way too resource greedy and anything you build with it will be heavy.
- billowycoat 3y agoResource greedy?? It runs just fine on a Raspberry Pi.
- tempnow987 3y agoThis can't be serious. The number of resources being consumed by web frameworks is absolutely insane, they are built on so many layers. .NET desktop apps the same thing. You need a full windows install, then graphics drivers, then the .NET framework stuff. This is running in a terminal. The golang tui's are tiny by comparison to apps like office etc and can deploy in much smaller total footprints.
- friend_and_foe 3y agoFor a TUI yes it's greedy.
- deleted 3y ago[deleted]
- ryanschaefer 3y agoThey say they support typing but I was weary as soon as they had a class field which defined actions. Python severely disappoints in its type system when compared to flow or typescript which are turning complete.
- deleted 3y ago[deleted]
- pvo50555 3y agoSeems a bit like www.anvil.works but it can be run entirely locally and a bit more feature restricted.
- deleted 3y ago[deleted]
- SaintSeiya 3y agoLazarus/Freepascal is the way to go. The rest are involutions.
- pudo 3y agoUnfortunately, the "Rapid Application Development" thing also seems to apply to the library itself: you get a new release every other week, and stuff breaks in somewhat unpredictable places. So it's easy to prototype something with Textual, but hard to maintain it afterwards.
- davepdotorg 3y agoI get that this can be annoying (as someone who maintains code written using Textual, I very much get it), but while we're still 0.x we are making the most of being able to steer in slightly different directions if a more beneficial approach becomes obvious in some area. We also try really hard to highlight breaking changes when a new release is made. And, of course, if anything particular is tricky to work around or get working again anyone is welcome to seek some help in GitHub issues, discussions or even on Discord if that's your thing.
- prakhar897 3y agoQuestion: How do projects like these sustain themselves? This project is being developed from 2 years and I see no sources of revenue. Do the developers get any form of compensation for creating this?
- billowycoat 3y agoOnlyFans mostly. Except for the CEO who can photosynthesize enough energy to sustain himself.
- bityard 3y agoThe vast majority of open source projects are undertaken and maintained as a hobby, or as a side project related to other paid work. You have to consider your market as well, literally nobody is going to pay money to use a terminal widget library in 2023.
- Flimm 3y agoThis particular project has raised seed funding. Textual's founder has written a blog post about it here, you may be interested in reading it: https://www.willmcgugan.com/blog/tech/post/from-open-source-maintainer-to-founder-ceo/ https://www.willmcgugan.com/blog/tech/post/from-open-source-...
- p2detar 3y agoLooks amazing! Not a seasoned Python developer, so I ask how easy it is to build a binary from this without any (major) dependencies? I’m looking for something that helps me build installation packages of my product for Windows and Linux. There are a set of configurations that must be done before and after my customers install my software - write to INI files, check db connection, check http servers and so on.
- hcrean 3y agoThere are many options, but Pyinstaller is in my experience the easiest one in this space.
- Loranubi 3y agoStill no multiline text inputs though…
- elmersidney53 3y ago[dead]