from_dict#

classmethod Rules.from_dict(data: dict[str, Any]) Rules#

Create Rules instance from dictionary.

Parameters:
datadict

Dictionary produced by json.load(), yaml.safe_load(), etc.

Returns:
Rules

Validated instance ready for Drc.check().

Examples

>>> import json
>>> with open("rules.json") as f:
...     data = json.load(f)
>>> rules = Rules.from_dict(data)