| [ Web Proxy ] |
| Viewing: https://wiki.python.org/moin/../python/platforms/../../python/testing/../archive/OptionParsing.html | [Back] [Original] |
Legacy Wiki Page
This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.
Overview of Python modules for option parsing
getopt - procedural interface in stdlib for refugees from the C camp
optparse - stdlib name for Optik, a revolutionary API for option parsing in Python 2.x
argparse - optparse pumped up for Python 3.x (and included in Python 2.7)
Name |
Latest Release |
Description |
|
|---|---|---|---|
103 |
0.11.0 (2020-10-27) |
gflags merged into this |
|
34 |
7.1.2 (2020-04-27) |
create beautiful command line interfaces in a composable way with as little code as necessary |
|
2321 |
0.3.2 (2020-08-16) |
build great CLIs. Easy to code. Based on Python type hints. |
More:
The option parsing goal can be split in two parts:
identifying the command user needs to execute
changing configuration for the program
For the first part, it will be good if option parsing library could handle subcommands. It is known that argparse can do this and optparse cannot. docopt probably handles this transparently.
For the second thing there should be some strategy to choose how (and which) options are merged into configuration to make the process of program configuration easy for the user and occasional patch contributors.
2026, Python Software Foundation
Made with Sphinx and Shibuya theme.
| Web Proxy Viewer | New URL | Original Page |