13 ms·
I love the idea of specifying a data structure to describe your program's inputs and generating different ways to enter that data. So far I've seen CLI entry w
by bbkane 4y ago
I love the idea of specifying a data structure to describe your program's inputs and generating different ways to enter that data.
So far I've seen CLI entry with Cobra, TUI with Boa, and Config file reader with Viper. Who knows, maybe someone will implement HTML or REST API generators next?
I'm writing my own Cobra alternative [1] so I can generate input methods "from the ground up" so I really enjoy seeing how others approach this problem, especially because my baby arrived early so my time is now much more limited :D
[1] - https://github.com/bbkane/warg/ https://github.com/bbkane/warg/
- jazzyjackson 4y agoI never had the use case for arbitrary nested input, but I did build a python library that allowed you to specify the HTML input type and the python type to coerce it to + regex validation so that our giant SQL queries would fail at the beginning and not half way thru I dabbled in generating the HTML forms for calling the scripts, but what I was really excited to do was design a chatbot that would use the type declarations to ask for the scripts' requirements conversationally ("next I need a number for...") (alas, the chatscript dialog files I wrote are not open source, I would love to revisit if anyone wants to take another stab at NLP->SQL) https://github.com/jazzyjackson/py-validate https://github.com/jazzyjackson/py-validate