TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Arguably – The best Python CLI library, arguably

6 pointsby jfktreyalmost 2 years ago
I spent the past few weeks working on arguably. It uses your function signatures and docstrings to create a CLI.<p>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.<p>It succeeds when you barely notice it&#x27;s there.<p>For most cases, you decorate a function with @arguably.command, and it just does what you&#x27;d expect:<p><pre><code> * 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 </code></pre> This also means it&#x27;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.<p>This is my first time making an open-source project with real testing and documentation, definitely a learning experience. mkdocs didn&#x27;t work for me at first, so I wrote some wild workarounds: <a href="https:&#x2F;&#x2F;treykeown.github.io&#x2F;arguably&#x2F;contributing&#x2F;#building-docs" rel="nofollow noreferrer">https:&#x2F;&#x2F;treykeown.github.io&#x2F;arguably&#x2F;contributing&#x2F;#building-...</a>

1 comment

lourotalmost 2 years ago
So nice!