sphobjinv.enum
Helper enums for sphobjinv
.
sphobjinv
is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
Brian Skinn (brian.skinn@gmail.com)
- File Created
4 May 2019
- Copyright
(c) Brian Skinn 2016-2024
- Source Repository
- Documentation
- License
Code: MIT License
Docs & Docstrings: CC BY 4.0 International License
See LICENSE.txt for full license terms.
Members
- class HeaderFields(*values)
Enum
for various inventory-level data items.A subset of these
Enum
values is used in various Regex, JSON, and string formatting contexts within class:~sphobjinv.inventory.Inventory andschema.json_schema
.- Count = 'count'
Number of objects contained in the inventory
- Metadata = 'metadata'
The
str
value of thisEnum
member is accepted as a root-level key in adict
to be imported into anInventory
. The corresponding value in thedict
may contain any arbitrary data. Its possible presence is accounted for inschema.json_schema
.The data associated with this key are ignored during import into an
Inventory
.
- Project = 'project'
Project name associated with an inventory
- Version = 'version'
Project version associated with an inventory
- class SourceTypes(*values)
Enum
for the import mode used in instantiating anInventory
.Since
Enum
keys iterate in definition order, the definition order here defines the order in whichInventory
objects attempt to parse a source object passed toInventory.__init__()
either as a positional argument or via the generic source keyword argument.This order DIFFERS from the documentation order, which is alphabetical.
- DictJSON = 'dict_json'
Instantiation from a
dict
validated againstschema.json_schema
.
- FnamePlaintext = 'fname_plain'
Instantiation from a plaintext objects.inv file on disk.
- FnameZlib = 'fname_zlib'
Instantiation from a zlib-compressed objects.inv file on disk.
- Manual = 'manual'
No source;
Inventory
was instantiated withproject
andversion
as empty strings andobjects
as an emptylist
.
- URL = 'url'
Instantiation from a zlib-compressed objects.inv file downloaded from a URL.