plac, the easiest command line arguments parser in the world

Tim Golden mail at timgolden.me.uk
Wed Jun 2 04:28:24 EDT 2010


On 02/06/2010 05:37, Michele Simionato wrote:
> I would like to announce to the world the first public release of
> plac:
>
>    http://pypi.python.org/pypi/plac
>
> Plac is a wrapper over argparse and works in all versions of
> Python starting from Python 2.3 up to Python 3.1.

I like it. I'm a constant user of the

   def main (a, b=1, c=2):
     # ...

   if __name__ == '__main__':
     main (*sys.argv[1:])

pattern, which provides a minimally semi-self-documenting
approach for positional args, but I've always found the existing
offerings just a little too much work to bother with.
I'll give plac a run and see how it behaves.

Thanks

TJG



More information about the Python-list mailing list