View module source on GitHub

Entity

class Entity(Enum)

Entity.

This class represents an entity.

DateTimeEncoder

class DateTimeEncoder(json.JSONEncoder)

DateTime encoder.

This class represents a date time encoder.

CommitLog

class CommitLog()

Commit log.

This class represents a commit log.

__init__

def __init__(entity: Entity,
             entity_id: str,
             action: str,
             data: Optional[Dict[str, Any]] = None)

Initialize a commit log.

Arguments:

NameDescription
entityThe entity of the commit log.
entity_idThe id of the entity.
actionThe action of the commit log.
dataThe data of the commit log.

serialize

def serialize(custom_data: Optional[Dict[str, Any]] = None) -> str

Serialize the commit log.

Arguments:

NameDescription
custom_dataThe custom data to serialize.

Returns:

NameDescription
strThe serialized commit log.

object_to_dict

def object_to_dict(obj: Any) -> Union[Dict, List, str, int, float, bool, None]

Convert a complex object structure to a dictionary, handling nested custom objects.

Arguments:

NameDescription
objAny Python object to convert

Returns:

A dictionary representation of the object

GenerationErrorTypedDict

class GenerationErrorTypedDict(TypedDict)

Generation error typed dict.

This class represents a generation error typed dict.

GenerationError

@deprecated(
    "This class is deprecated and will be removed in a future version. Use GenerationErrorTypedDict instead."
)

@dataclass
class GenerationError()

@deprecated: This class is deprecated and will be removed in a future version. Use GenerationErrorTypedDict instead.