[ANN] argparse 0.1 - Command-line parsing library

Discussion in 'Python' started by Steven Bethard, Oct 9, 2006.

  1. Announcing argparse 0.1
    -----------------------

    argparse home:
    http://argparse.python-hosting.com/

    argparse at PyPI:
    http://www.python.org/pypi/argparse/0.1.0

    argparse module download:
    http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw


    About this release
    ==================

    This release fixes a few minor bugs and adds the 'outfile' type.
    Extensive updates to the API documentation make this the most
    thoroughly documented release yet:
    http://argparse.python-hosting.com/wiki/ArgumentParser


    New in this release
    ===================

    * The 'outfile' type.
    * API documentation.


    About argparse
    ==============

    The argparse module is an optparse-inspired command line parser that
    improves on optparse by:

    * handling both optional and positional arguments
    * supporting parsers that dispatch to sub-parsers
    * producing more informative usage messages
    * supporting actions that consume any number of command-line args
    * allowing types and actions to be specified with simple callables
    instead of hacking class attributes like STORE_ACTIONS or
    CHECK_METHODS

    as well as including a number of other more minor improvements on the
    optparse API. To whet your appetite, here's a simple program that sums
    its command-line arguments and writes them to a file::

    parser = argparse.ArgumentParser()
    parser.add_argument('integers', type=int, nargs='+')
    parser.add_argument('--log', type='outfile', default=sys.stdout)
    args = parser.parse_args()
    args.log.write('%s\n' % sum(args.integers))
    args.log.close()
    Steven Bethard, Oct 9, 2006
    #1
    1. Advertising

  2. Steven Bethard wrote:
    > Announcing argparse 0.1
    > -----------------------
    >
    > argparse home:
    > http://argparse.python-hosting.com/
    >
    > argparse at PyPI:
    > http://www.python.org/pypi/argparse/0.1.0
    >
    > argparse module download:
    > http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw


    The argparse module is now also available through PyPI with source and
    Windows binary downloads:

    http://cheeseshop.python.org/packages/source/a/argparse/argparse-0.1.0.tar.gz
    http://cheeseshop.python.org/packages/any/a/argparse/argparse-0.1.0.win32.exe

    Happy parsing!
    Steven Bethard, Oct 11, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Bethard
    Replies:
    0
    Views:
    257
    Steven Bethard
    Oct 24, 2006
  2. Steven Bethard
    Replies:
    0
    Views:
    266
    Steven Bethard
    Dec 5, 2006
  3. Steven Bethard
    Replies:
    0
    Views:
    279
    Steven Bethard
    Jan 5, 2007
  4. Steven Bethard
    Replies:
    0
    Views:
    276
    Steven Bethard
    Jan 17, 2007
  5. Steven Bethard
    Replies:
    0
    Views:
    293
    Steven Bethard
    Feb 24, 2007
Loading...

Share This Page