API Reference
trivrepr.TrivialRepr
Helper class that generates a repr() string.
Derived classes should take care that all arguments to the init() method correspond to object attributes with exactly the same names.
Source code in src/trivrepr/__init__.py
__repr__()
Provide a Python-esque representation of the object.
trivrepr.TrivialReprWithJson
Bases: TrivialRepr
Helper class that also provides a .to_json()
method.
Source code in src/trivrepr/__init__.py
to_json()
Provide a dictionary describing the object's properties.
Any property value that is an object implementing a .to_json()
method will have this method invoked to obtain the dictionary value.
Dictionaries, lists, and sets will be recursively descended into
(set elements are also sorted); pathlib.Path
objects will be
converted into strings. Any other objects are stored as they are.