jsonschema_diff.config_maker

Factory for a ready-to-use jsonschema_diff.core.Config instance.

All optional switches are enabled by default; pass False to disable.

Classes

MultilineChars

MultilineListRender

Create a collection of name/value pairs.

ConfigMaker

Helper that builds a fully populated Config.

Module Contents

class MultilineChars[source]
START_LINE: str[source]
MIDDLE_LINE: str[source]
END_LINE: str[source]
SINGLE_LINE: str[source]
class MultilineListRender(*args, **kwds)[source]

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Soft[source]
Hard[source]
Double[source]
Without[source]
class ConfigMaker[source]

Helper that builds a fully populated Config.

static make(
*,
tab_size: int = 1,
all_for_rendering: bool = False,
crop_path: bool = True,
path_render_with_properies: bool = False,
path_render_with_items: bool = False,
list_comparator: bool = True,
list_multiline_render: MultilineListRender = MultilineListRender.Soft,
range_digit_comparator: bool = True,
range_length_comparator: bool = True,
range_items_comparator: bool = True,
range_properties_comparator: bool = True,
additional_compare_rules: jsonschema_diff.core.tools.compare.COMPARE_RULES_TYPE = {},
additional_combine_rules: jsonschema_diff.core.tools.combine.COMBINE_RULES_TYPE = [],
additional_pair_context_rules: jsonschema_diff.core.tools.context.PAIR_CONTEXT_RULES_TYPE = [],
additional_context_rules: jsonschema_diff.core.tools.context.CONTEXT_RULES_TYPE = {},
additional_path_maker_ignore: jsonschema_diff.core.tools.render.PATH_MAKER_IGNORE_RULES_TYPE = [],
) Config[source]

Assemble and return a Config.

Parameters:
  • tab_size (int) – Number of spaces per indentation level.

  • path_render_with_properies (bool) – Include these schema service tokens in rendered paths.

  • path_render_with_items (bool) – Include these schema service tokens in rendered paths.

  • list_comparator (bool) – Enable CompareList.

  • list_multiline_render (MultilineListRender) – How to render multi-line elements of list.

  • range_*_comparator (bool) – Enable CompareRange for numeric/length/items/properties limits.

  • additional_* (collections) – User-supplied rules that override the built-ins.