airbyte_cdk.sources.declarative.extractors.record_extractor

 1#
 2# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
 3#
 4from abc import abstractmethod
 5from dataclasses import dataclass
 6from typing import Any, Iterable, Mapping
 7
 8import requests
 9
10
11@dataclass
12class RecordExtractor:
13    """
14    Responsible for translating an HTTP response into a list of records by extracting records from the response.
15    """
16
17    @abstractmethod
18    def extract_records(
19        self,
20        response: requests.Response,
21    ) -> Iterable[Mapping[str, Any]]:
22        """
23        Selects records from the response
24        :param response: The response to extract the records from
25        :return: List of Records extracted from the response
26        """
27        pass
@dataclass
class RecordExtractor:
12@dataclass
13class RecordExtractor:
14    """
15    Responsible for translating an HTTP response into a list of records by extracting records from the response.
16    """
17
18    @abstractmethod
19    def extract_records(
20        self,
21        response: requests.Response,
22    ) -> Iterable[Mapping[str, Any]]:
23        """
24        Selects records from the response
25        :param response: The response to extract the records from
26        :return: List of Records extracted from the response
27        """
28        pass

Responsible for translating an HTTP response into a list of records by extracting records from the response.

@abstractmethod
def extract_records(self, response: requests.models.Response) -> Iterable[Mapping[str, Any]]:
18    @abstractmethod
19    def extract_records(
20        self,
21        response: requests.Response,
22    ) -> Iterable[Mapping[str, Any]]:
23        """
24        Selects records from the response
25        :param response: The response to extract the records from
26        :return: List of Records extracted from the response
27        """
28        pass

Selects records from the response

Parameters
  • response: The response to extract the records from
Returns

List of Records extracted from the response