Tuesday, 20 June 2023

New Show Hacker News story: latest news

Show HN: Arguably – The best Python CLI library, arguably
3 by jfktrey | 0 comments on Hacker News.
I spent the past few weeks working on arguably. It uses your function signatures and docstrings to create a CLI. I built it to have the most common features of other libraries (and a few extra) in a much more concise syntax - no need for @click.option or typer.Option. It succeeds when you barely notice it's there. For most cases, you decorate a function with @arguably.command, and it just does what you'd expect: * Positional args for the function become positional CLI args * Keyword-only args become --options * Type hints set up parsing * Docstrings provide help messages for each command and argument This also means it's good at making a script into a CLI without any integration at all, like Python Fire does. Just run `python3 -m arguably your_script.py` to give your script a CLI. This is my first time making an open-source project with real testing and documentation, definitely a learning experience. mkdocs didn't work for me at first, so I wrote some wild workarounds: https://ift.tt/nHzW9ur...

No comments:

Post a Comment