installation_instruction

Submodules

Attributes

__version__

__description__

__repository__

__author__

__author_email__

__license__

Classes

InstallationInstruction

Class holding schema and template for validating and rendering installation instruction.

Functions

_get_flags_and_options(→ list[click.Option])

Generates Click flags and options from a JSON schema.

Package Contents

installation_instruction.__version__
installation_instruction.__description__
installation_instruction.__repository__
installation_instruction.__author__
installation_instruction.__author_email__
installation_instruction.__license__
class installation_instruction.InstallationInstruction(config: str)

Class holding schema and template for validating and rendering installation instruction.

validate_and_render(input: dict) tuple[str, bool]

Validates user input against schema and renders with the template. Returns installation instructions and False. If jinja macro raise is called returns error message and True.

Parameters:

input – Enduser input.

Ptype input:

dict

Returns:

Returns instructions as string and False. Or Error and True.

Rtpye:

(str, bool)

Raises:

Exception – If schema or user input is invalid.

parse_schema() dict

Parses schema into a dict.

This is only important for merging enum, anyOf and oneOf into one type.

Returns:

Schema as dict.

Return type:

dict

classmethod from_file(path: str)

Returns class initialized via config file from path.

Parameters:

path – Path to config file.

Ptype path:

str

Returns:

InstallationInstruction class

Return type:

InstallationInstruction

installation_instruction._get_flags_and_options(schema: dict, misc: dict = None) list[click.Option]

Generates Click flags and options from a JSON schema.

Parameters:
  • schema (dict) – Schema which contains the options.

  • misc – Additional descriptions and pretty print names nested.

Returns:

List of all the clickoptions from the schema.

Return type:

list[Option]