sphobjinv.cli.load
Module for sphobjinv
CLI Inventory
loading.
sphobjinv
is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
Brian Skinn (brian.skinn@gmail.com)
- File Created
17 Nov 2020
- Copyright
(c) Brian Skinn 2016-2022
- Source Repository
- Documentation
- License
Code: MIT License
Docs & Docstrings: CC BY 4.0 International License
See LICENSE.txt for full license terms.
Members
- import_infile(in_path)
Attempt import of indicated file.
Convenience function wrapping attempts to load an
Inventory
from a local path.
- inv_local(params)
Create
Inventory
from local source.Uses
resolve_inpath()
to sanity-check and/or convertINFILE
.Calls
sys.exit()
internally in error-exit situations.- Parameters
params –
dict
– Parameters/values mapping from the active subparser- Returns
inv –
Inventory
– Object representation of the inventory atINFILE
in_path –
str
– Input file path as resolved/checked byresolve_inpath()
- inv_stdin(params)
Create
Inventory
from contents of stdin.Due to stdin’s encoding and formatting assumptions, only text-based inventory formats can be sanely parsed.
Thus, only plaintext and JSON inventory formats can be used as inputs here.
- inv_url(params)
Create
Inventory
from file downloaded from URL.Initially, treats
INFILE
as a download URL to be passed to the url initialization argument ofInventory
.If an inventory is not found at that exact URL, progressively searches the directory tree of the URL for objects.inv.
Injects the URL at which an inventory was found into params under the
FOUND_URL
key.Calls
sys.exit()
internally in error-exit situations.