Command-Line Usage

The CLI for sphobjinv is implemented using two subparsers, one each for the convert and suggest sub-functions. More information about the implementation of these features can be found here and in the documentation for the Inventory object, in particular the data_file() and suggest() methods.

Some notes on these CLI docs:

  • CLI examples are executed in a sandboxed directory pre-loaded with objects_attrs.inv (from, e.g., here).
  • Path (from pathlib) is imported into the namespace before all tests.
  • cli_run is a helper function that enables doctesting of CLI examples by mimicking execution of a shell command. It is described in more detail here.
  • file_head is a helper function that retrieves the head of a specified file.

The options for the parent sphobjinv command are:

-h, --help

Show help message and exit

>>> cli_run('sphobjinv --help')
usage: sphobjinv [-h] [-v] {convert,suggest} ...

Format conversion for and introspection of intersphinx 'objects.inv' files.

optional arguments:
  -h, --help         show this help message and exit
  -v, --version      Print package version & other info

Subcommands:
  {convert,suggest}  Execution mode. Type 'sphobjinv [mode] -h' for more
                     information on available options. Mode names can be
                     abbreviated to their first two letters.
    convert (co)     Convert intersphinx inventory to zlib-compressed,
                     plaintext, or JSON formats.
    suggest (su)     Fuzzy-search intersphinx inventory for desired object(s).
-v, --version

Print package version & other info

>>> cli_run('sphobjinv --version')

sphobjinv v2.0

Copyright (c) Brian Skinn 2016-2018
License: The MIT License

Bug reports & feature requests: https://github.com/bskinn/sphobjinv
Documentation: http://sphobjinv.readthedocs.io