Clize 3.0b1: An argument parser that draws a CLI from your function sigature
Chris Angelico
rosuav at gmail.com
Mon Apr 27 20:03:36 EDT 2015
On Mon, Apr 27, 2015 at 7:02 PM, Yann Kaiser <kaiser.yann at gmail.com> wrote:
> Hello everyone!
>
> After a few years in development, I am proud to say Clize is landing its
> feet again and is now in beta for an upcoming release.
>
> You can try it out using pip install --user clize=3.0b1 and you can
> browse the docs at https://clize.readthedocs.org/
>
> For those who'd like an explanation before clicking links, here's Clize's
> 5-bullet point explanation:
>
> * Command-line interfaces are created by passing functions to `clize.run`.
> * Parameter types are deduced from the functions' parameters.
> * A ``--help`` message is generated from your docstrings. (Why does this
> still need to be a bullet point?)
> * Decorators can be used to reuse functionality across functions.
> * Clize can be extended with new parameter behavior.
Interesting. I've also been working on a simpler arg handling module;
maybe we can work together. The goals for mine are:
* Each function should be as independent as possible.
* Minimize repetition (of names, descriptions, etc)
* Keep everything in the function signature
* Simplify the basic and obvious usages
https://github.com/Rosuav/docstringargs
https://pypi.python.org/pypi/docstringargs/
There's a demo file in the source repo, plus here are a couple of
actual usage examples:
https://github.com/Rosuav/LetMeKnow/blob/master/letmeknow.py
https://github.com/MikeiLL/appension/blob/master/fore/database.py
The latter is an existing module in an existing project, and it grew a
command-line interface with minimal changes, eg:
https://github.com/MikeiLL/appension/commit/566f195
Can we merge our plans and make a single module that's more likely to
be maintained long-term? No point over-duplicating!
ChrisA
More information about the Python-list
mailing list