databay.inlets.http_inlet

Warning

HttpInlet requires AIOHTTP to function. Please install required dependencies using:

pip install "databay[HttpInlet]"

class databay.inlets.http_inlet.HttpInlet(url: str, json: str = True, cacert: Optional[str] = None, params: Optional[dict] = None, headers: Optional[LooseHeaders] = None, *args, **kwargs)[source]

databay.inlets.http_inlet.HttpInlet

Inlet for pulling data from a specified URL using aiohttp.

Parameters
  • url (str) – URL that should be queried for data.

  • json (bool) – Whether response should be parsed as JSON.

    Default:
    True

  • cacert (str) – Path to cacert TLS certificate bundle.

    Default:
    None

  • params (dict) – Parameters for the request.

    Default:
    None

  • headers (LooseHeaders) – Headers for the request.

    Default:
    None

Bases: databay.inlet.Inlet

pull(self, update) → Union[List[Record], str][source]

async

Asynchronously pulls data from the specified URL using aiohttp.ClientSession.get

Parameters

update (Update) – Update object representing the particular Link transfer.

Returns

Single or multiple records produced.

Return type

Record or list[Record]