epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval =================================================================== .. py:module:: epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval .. autoapi-nested-parse:: Module for an asynchronous version of archiver retriever. Classes ------- .. autoapisummary:: epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval.AsyncArchiverRetrieval Functions --------- .. autoapisummary:: epicsarchiver.retrieval.archiver_retrieval.async_archiver_retrieval._format_date Module Contents --------------- .. py:function:: _format_date(at: datetime.datetime) -> str .. py:class:: AsyncArchiverRetrieval(hostname: str = 'localhost', port: int = 17665) Bases: :py:obj:`epicsarchiver.common.async_service.ServiceClient` Async retrieval client for the EPICS archiver appliance. Hold a session to the Archiver Appliance server to make retrieval requests. :param hostname: EPICS Archiver Appliance hostname [default: localhost] :param port: EPICS Archiver Appliance management port [default: 17665] Examples: .. code-block:: python from epicsarchiver.archiver.retrieval import AsyncArchiverRetrieval async with AsyncArchiverRetrieval("archiver-01.tn.esss.lu.se") as archappl: events = await archappl.get_events( "my:pv", start=datetime.now(tz=UTC) - timedelta(seconds=1), end=datetime.utcnow(), ) .. py:attribute:: hostname :value: 'localhost' .. py:attribute:: port :value: 17665 .. py:attribute:: _data_url :type: str | None :value: None .. py:method:: data_url() -> str :async: EPICS Archiver Appliance data retrieval URL. :raises ArchiverResponseError: Raises if archiver not available :returns: URL of retrieval engine :rtype: str .. py:method:: _get_data_raw(pv: str, start: datetime.datetime, end: datetime.datetime) -> aiohttp.ClientResponse :async: Fetch raw response from archiver data retrieval URL. :param pv: PV data requested for. :type pv: str :param start: Start time of period. :type start: datetime.datetime :param end: End time of period. :type end: datetime.datetime :returns: Raw response from the archiver. :rtype: ClientResponse .. py:method:: get_events(pv: str, start: datetime.datetime, end: datetime.datetime, processor: epicsarchiver.retrieval.archiver_retrieval.processor.Processor | None = None) -> list[epicsarchiver.retrieval.archive_event.ArchiveEvent] :async: Get a list of events from the archiver for specified pv and time period. :param pv: PV data requested for. :type pv: str :param start: Start time of the time period. :type start: datetime.datetime :param end: End time fo the time period. :type end: datetime.datetime :param processor: Optional Preprocessor to use. Defaults to None. :type processor: Processor | None, optional :returns: List of events in time period. :rtype: list[ArchiveEvent] .. py:method:: get_all_events(pvs: set[str], start: datetime.datetime, end: datetime.datetime, processor: epicsarchiver.retrieval.archiver_retrieval.processor.Processor | None = None) -> dict[str, list[epicsarchiver.retrieval.archive_event.ArchiveEvent]] :async: Get a list of events for every pv requested. Makes all the calls to the archiver asynchronously, so some maybe made in parallel. :param pvs: Set of pvs data wanted for. :type pvs: set[str] :param start: Start time of period. :type start: datetime.datetime :param end: End time of period. :type end: datetime.datetime :param processor: Optional choice of Preprocessor. Defaults to None. :type processor: Processor | None, optional :returns: Dictionary of pvs (keys) and events (values). :rtype: dict[str, list[ArchiveEvent]]