sphobjinv.cli.parser¶
sphobjinv CLI parser definition module.
sphobjinv is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
Brian Skinn (bskinn@alum.mit.edu)
- File Created
15 Nov 2020
- Copyright
(c) Brian Skinn 2016-2021
- Source Repository
- Documentation
- License
The MIT License; see LICENSE.txt for full license terms
Members
-
class
PrsConst¶ Container for CLI parser constants.
-
ALL= 'all'¶ Optional argument name for use with the
SUGGESTsubparser, indicating to print all returned objects, regardless of the number returned, without asking for confirmation
-
CONTRACT= 'contract'¶ Optional argument name for use with the
CONVERTsubparser, indicating to contract URIs and display names to abbreviated forms in the generated output file
-
CONVERT= 'convert'¶ Subparser name for inventory file conversions; stored in
SUBPARSER_NAMEwhen selected
-
DEF_OUT_EXT= {'json': '.json', 'plain': '.txt', 'zlib': '.inv'}¶ Default extensions for an unspecified
OUTFILE
-
DEF_THRESH= 75¶ Default match threshold for
sphobjinv suggest --thresh
-
EXPAND= 'expand'¶ Optional argument name for use with the
CONVERTsubparser, indicating to expand URI and display name abbreviations in the generated output file
-
FOUND_URL= 'found_url'¶ Dict key for URL at which an inventory was actually found
-
HELP_CONV_EXTS= "'.inv/.txt/.json'"¶ Help text for default extensions for the various conversion types
-
HELP_CO_PARSER= 'Convert intersphinx inventory to zlib-compressed, plaintext, or JSON formats.'¶ Help text for the
CONVERTsubparser
-
HELP_SU_PARSER= 'Fuzzy-search intersphinx inventory for desired object(s).'¶ Help text for the
SUGGESTsubparser
-
INDEX= 'index'¶ Optional argument name for use with the
SUGGESTsubparser, indicating to print the location index of each returned object withinINFILEalong with the object domain/role/name (may be specified withSCORE)
-
INFILE= 'infile'¶ Required positional argument name for use with both
CONVERTandSUGGESTsubparsers, holding the path (or URL, ifURLis specified) to the input file
-
MODE= 'mode'¶ Positional argument name for use with
CONVERTsubparser, indicating output file format (ZLIB,PLAINorJSON)
-
OUTFILE= 'outfile'¶ Optional positional argument name for use with the
CONVERTsubparser, holding the path to the output file (DEF_BASENAMEand the appropriate item fromDEF_OUT_EXTare used if this argument is not provided)
-
OVERWRITE= 'overwrite'¶ Optional argument name for use with the
CONVERTsubparser, indicating to overwrite any existing output file without prompting
-
QUIET= 'quiet'¶ Optional argument name for use with the
CONVERTsubparser, indicating to suppress console output
-
SCORE= 'score'¶ Optional argument name for use with the
SUGGESTsubparser, indicating to print thefuzzywuzzyscore of each returned object withinINFILEalong with the object domain/role/name (may be specified withINDEX)
-
SEARCH= 'search'¶ Positional argument name for use with the
SUGGESTsubparser, holding the search term forfuzzywuzzytext matching
-
SUGGEST= 'suggest'¶ Subparser name for inventory object suggestions; stored in
SUBPARSER_NAMEwhen selected
-
SUGGEST_CONFIRM_LENGTH= 30¶ Number of returned objects from a
SUGGESTsubparser invocation above which user will be prompted for confirmation to print the results (unlessALLis specified)
-
THRESH= 'thresh'¶ Optional argument name for use with the
SUGGESTsubparser, taking the minimum desiredfuzzywuzzymatch quality as one required argument
-
URL= 'url'¶ Optional argument name for use with both
CONVERTandSUGGESTsubparsers, indicating thatINFILEis to be treated as a URL rather than a local file path
-
VERSION= 'version'¶ Optional argument name for use with the base argument parser, to show version &c. info, and exit
-
VER_TXT= '\nsphobjinv v2.1\n\nCopyright (c) Brian Skinn 2016-2021\nLicense: The MIT License\n\nBug reports & feature requests: https://github.com/bskinn/sphobjinv\nDocumentation: https://sphobjinv.readthedocs.io\n'¶ Version &c. output blurb
-
-
getparser()¶ Generate argument parser.
- Returns
prs –
ArgumentParser– Parser for commandline usage ofsphobjinv