Printer๏
The fundamental core printer classes for the entire package.
Classes:
Generic base class for pretty printing. |
|
Extends the functionality of a |
- class musify.printer.PrettyPrinter๏
Bases:
objectGeneric base class for pretty printing. Classes can inherit this class to gain pretty print functionality.
Methods:
as_dict()Return a dictionary representation of the key attributes of this object.
json()Return a dictionary representation of the key attributes of this object that is safe to output to JSON
- abstractmethod as_dict()๏
Return a dictionary representation of the key attributes of this object.
- Return type:
dict[str,Any]
- The results of this function are used to produce the following:
A JSON representation of the object when calling
json()The string representation of the object when calling str() on the object
The representation of the object when calling repr() on the object
- json()๏
Return a dictionary representation of the key attributes of this object that is safe to output to JSON
- Return type:
dict[str,str|int|float|list|dict|bool|None]
- class musify.printer.AttributePrinter๏
Bases:
PrettyPrinterExtends the functionality of a
PrettyPrinter.Adds functionality to automatically determine the key attributes that represent child objects and uses these for printer representations.
Methods:
as_dict()Return a dictionary representation of the key attributes of this object.
- as_dict()๏
Return a dictionary representation of the key attributes of this object.
- Return type:
dict[str,Any]
- The results of this function are used to produce the following:
A JSON representation of the object when calling
json()The string representation of the object when calling str() on the object
The representation of the object when calling repr() on the object