5 ms·
Show HN: Beautiful Python List Prompts Package
- mr_cyborg 8y agoI like this a lot. Will definitely try it out at some point.
- whalesalad 8y agoWhat are the use cases? This looks like a fun project without any real applications. A react component makes sense because it hooks into an existing ecosystem but how would something like this get used in an existing cli? Edit: React has an ecosystem for things like this. Cocoa/Obj-C has an ecosystem for things like this. Tiny single purpose UI elements. Python does not have this because there is no UI framework for doing console applications that doesn’t already provide this capability as part of a batteries included tool.
- fermentation 8y agoI can think of a lot of simple scripts that I could easily plug this into. When I’m writing a little script to do something for me, the last thing I want to do is write any sort of UI
- Sean1708 8y agoOh god the amount of scripts I have that do something like: while True: for i, item in enumerate(list): print(i, item, sep=" - ") choice = input() if valid(choice): break This would make those so much easier to write and give a much nicer UI at the same time.
- whalesalad 8y agoCan’t tell if you’re being sarcastic or not. Your above sample code is perfectly simple and straightforward. I would choose it over an over engineered ui library/dependency in a heartbeat.
- lawik 8y agoI don't quite follow you here. It is a library for making some simple UI for command line applications. If you have a command line application in python you could implement this for fancier list selections. I'm unclear on how you relate this to React components. Python libraries have been part of an existing ecosystem long before React. The python ecosystem.
- benbristow 8y agoIt’s just a command line library for spliffying up command line interfaces. Where does React come into this? That’s for the web...
- Evidlo 8y agoLooks cool. I'd like to see more widgets though, like a checkbox or simple form widget. One package just for a radio list is too much like the npm way of doing things.
- deleted 8y ago[deleted]
- Mckinsey666 8y agoThanks for the feedback. I will add more features to this package asap.
- black-tea 8y agoIf there's one trend I can't stand it's developers claiming that their own projects are "beautiful".
- scbrg 8y agoAh, natural languages and their lack of grouping operators. It's (Beautiful Python List Prompts) Package, not Beautiful (Python List Prompts Package).
- black-tea 8y agoOh, so the former is not actually making any claims about being beautiful? Please... Just tell me what it does. I'll decide if it's beautiful.
- uryga 8y agoi'd say "beautiful" in this context is shorthand for "built with attention towards aesthetics", which is often not the case for programmer tools like this
- lars512 8y agoThis is really nice. I'm working on a similar project right now, trying to hook together a few console UI pieces like this into a coherent annotation tool: https://github.com/larsyencken/questioner/ https://github.com/larsyencken/questioner/ It's not as pretty as bullet, but it's trying to fit in an annotation loop. It would be super cool to extend bullet to choose-many questions too.
- Mckinsey666 8y agoThanks for the feedback! Will definitely add more features to this package. Wrapping up several prompts together is a great idea too, thanks for the insight.
- ethanpil 8y agoFYI, not exactly the same, but Dialog is an excellent tool for creating ncurses based GUIs for shell scripts... http://www.unixcl.com/2009/12/linux-dialog-utility-short-tutorial.html http://www.unixcl.com/2009/12/linux-dialog-utility-short-tut...
- Mckinsey666 8y agoGee, this is legit. Gave me some insights. Thanks a lot :)!
- rajasimon 8y agoI want this from Python Click. I remember I asked him on Twitter long back don't know it's ported to Click. https://github.com/mitsuhiko/dialoguer https://github.com/mitsuhiko/dialoguer https://twitter.com/rajasimon/status/902894641770618880 https://twitter.com/rajasimon/status/902894641770618880
- BerislavLopac 8y agoWell there is Gooey, FWIW: https://pypi.org/project/Gooey/ https://pypi.org/project/Gooey/
- mlevental 8y agodo you know of an other package that does this? just yesterday and this morning I was looking for something like this but I could've sworn there's a more modern package. I just can't seem to find the right Google keywords to land on it. edit: and in particular for click. i didn't realize gooey was for arg parse
- sikhnerd 8y agoPossibly https://github.com/szsdk/quick https://github.com/szsdk/quick ?
- nmstoker 8y agoFirst thoughts were that this was handled by Prompt Toolkit, but it's actually a slightly different case to the auto complete which that one offers: https://python-prompt-toolkit.readthedocs.io/en/stable https://python-prompt-toolkit.readthedocs.io/en/stable Might be useful to handle deactivated choices (ie greyed out). It looks like it handles multi choice (with the check feature), but can it do validation upon a check being selected or does it need to wait until the user has made their choice? Am thinking for catching invalid combinations.
- Mckinsey666 8y agoHey HN I've added some new features including a prompt wrapper object to wrap the UI components together. Please check it out: https://github.com/Mckinsey666/bullet/blob/master/DOCUMENTATION.md https://github.com/Mckinsey666/bullet/blob/master/DOCUMENTAT...
- Mckinsey666 8y agobtw thanks to lars512 for the advice.
- alex_g 8y agoThis is awesome, I've been using Pick, but this looks a lot nicer!
- slurryer 8y agotermios issue. I installed this via pip in python 3.7 under windows 10 and got an error about the termios package not being available. But trying to install termios via pip reports that the package is not available. Any suggestions?
- rcfox 8y agoThe readme only claims to support Linux. termios is a built-in package, but not for Windows. https://docs.python.org/3/library/termios.html https://docs.python.org/3/library/termios.html
- wonderfuly 8y agoI've previously built a similar package, much simpler: https://github.com/wong2/pick https://github.com/wong2/pick
- spark888 8y agoThere is similar project https://github.com/Kamik423/cutie https://github.com/Kamik423/cutie for someone who is interested in cli dialogs.