Skip to main content

Event

Create an event.

def Event(
type: string,
_fields: dict = None,
__dict__: callable = dict,
__now__: callable = time.time,
**fields: any
) - > dict

Create an event.

Parameters

NameTypeDescription
typestringThe category or name of the event being recorded.
_fieldsdict = NoneAn optional dictionary of initial event data to be merged.
dictcallable = dictThe dictionary constructor or factory function used to instantiate the event object.
nowcallable = time.timeA function that returns the current time, used to populate the timestamp if it is missing.
**fieldsanyAdditional keyword arguments to be included as fields in the event dictionary.

Returns

TypeDescription
dictA dictionary representing the event, containing the specified type, fields, and a timestamp.