epicsarchiver.retrieval.archive_event ===================================== .. py:module:: epicsarchiver.retrieval.archive_event .. autoapi-nested-parse:: Archive Event module for the ArchiveEvent class. Classes ------- .. autoapisummary:: epicsarchiver.retrieval.archive_event.FieldValue epicsarchiver.retrieval.archive_event.ArchiveEvent Functions --------- .. autoapisummary:: epicsarchiver.retrieval.archive_event.year_timestamp epicsarchiver.retrieval.archive_event.ysn_timestamp epicsarchiver.retrieval.archive_event.dataframe_from_events Module Contents --------------- .. py:class:: FieldValue Basic representation of a changed field value from an archive event. :returns: Pair of name and value :rtype: FieldValue .. py:attribute:: name :type: str | None .. py:attribute:: value :type: str | None .. py:class:: ArchiveEvent One Event, retrieved from the AA, representing a change in value of a PV. .. py:attribute:: pv :type: str .. py:attribute:: val :type: int | float | str | list[str] | list[int] | list[float] | bytes .. py:attribute:: secondsintoyear :type: int .. py:attribute:: year :type: int .. py:attribute:: nanos :type: int .. py:attribute:: severity :type: int .. py:attribute:: status :type: int .. py:attribute:: field_values :type: list[FieldValue] | None .. py:property:: timestamp :type: datetime.datetime Provides a datetime for the archive event. This will lose information (the last few decimal places) since datetime does not handle nano seconds. :returns: datetime for event :rtype: datetime .. py:property:: pd_timestamp :type: pandas.Timestamp Provides a pandas Timestamp for the archive event. :returns: datetime for event :rtype: datetime .. py:function:: year_timestamp(year: int) -> int Generates int timestamp for number of seconds from unix epoch at start of year. :param year: year :type year: int :returns: seconds from epoch of start of year. :rtype: int .. py:function:: ysn_timestamp(year: int, seconds: int, nanos: int) -> pandas.Timestamp Get datetime from year, seconds into year and nanoseconds. :param year: year :type year: int :param seconds: seconds into year :type seconds: int :param nanos: nanoseconds :type nanos: int :returns: datetime :rtype: Timestamp .. py:function:: dataframe_from_events(events: list[ArchiveEvent]) -> pandas.DataFrame Converts a list of ArchiveEvent to pd.DataFrame. :param events: input events :type events: list[ArchiveEvent] :returns: Output dataframe with columns "date", "val" where "date" is index column. :rtype: pd.DataFrame