Submodules
airbyte_cdk.sources.declarative.extractors.dpath_extractor module
- class airbyte_cdk.sources.declarative.extractors.dpath_extractor.DpathExtractor(field_path: List[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]], config: Mapping[str, Any], parameters: dataclasses.InitVar[Mapping[str, Any]], decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder())
Bases:
airbyte_cdk.sources.declarative.extractors.record_extractor.RecordExtractor
Record extractor that searches a decoded response over a path defined as an array of fields.
If the field path points to an array, that array is returned. If the field path points to an object, that object is returned wrapped as an array. If the field path points to an empty object, an empty array is returned. If the field path points to a non-existing path, an empty array is returned.
Examples of instantiating this transform: ```
- extractor:
type: DpathExtractor field_path:
“root”
“data”
- field_path
Path to the field that should be extracted
- Type
Union[InterpolatedString, str]
- config: Mapping[str, Any]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- extract_records(response: requests.models.Response) List[Mapping[str, Any]]
Selects records from the response :param response: The response to extract the records from :return: List of Records extracted from the response
- field_path: List[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
airbyte_cdk.sources.declarative.extractors.http_selector module
- class airbyte_cdk.sources.declarative.extractors.http_selector.HttpSelector
Bases:
object
Responsible for translating an HTTP response into a list of records by extracting records from the response and optionally filtering records based on a heuristic.
- abstract select_records(response: requests.models.Response, stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[airbyte_cdk.sources.declarative.types.Record]
Selects records from the response :param response: The response to select the records from :param stream_state: The stream state :param stream_slice: The stream slice :param next_page_token: The paginator token :return: List of Records selected from the response
airbyte_cdk.sources.declarative.extractors.record_extractor module
- class airbyte_cdk.sources.declarative.extractors.record_extractor.RecordExtractor
Bases:
object
Responsible for translating an HTTP response into a list of records by extracting records from the response.
- abstract extract_records(response: requests.models.Response) List[Mapping[str, Any]]
Selects records from the response :param response: The response to extract the records from :return: List of Records extracted from the response
airbyte_cdk.sources.declarative.extractors.record_filter module
- class airbyte_cdk.sources.declarative.extractors.record_filter.RecordFilter(parameters: dataclasses.InitVar[Mapping[str, Any]], config: Mapping[str, Any], condition: str = '')
Bases:
object
Filter applied on a list of Records
config (Config): The user-provided configuration as specified by the source’s spec condition (str): The string representing the predicate to filter a record. Records will be removed if evaluated to False
- condition: str = ''
- config: Mapping[str, Any]
- filter_records(records: List[Mapping[str, Any]], stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[Mapping[str, Any]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
airbyte_cdk.sources.declarative.extractors.record_selector module
- class airbyte_cdk.sources.declarative.extractors.record_selector.RecordSelector(extractor: airbyte_cdk.sources.declarative.extractors.record_extractor.RecordExtractor, config: typing.Mapping[str, typing.Any], parameters: dataclasses.InitVar[typing.Mapping[str, typing.Any]], record_filter: typing.Optional[airbyte_cdk.sources.declarative.extractors.record_filter.RecordFilter] = None, transformations: typing.List[airbyte_cdk.sources.declarative.transformations.transformation.RecordTransformation] = <factory>)
Bases:
airbyte_cdk.sources.declarative.extractors.http_selector.HttpSelector
Responsible for translating an HTTP response into a list of records by extracting records from the response and optionally filtering records based on a heuristic.
- extractor
The record extractor responsible for extracting records from a response
- Type
- record_filter
The record filter responsible for filtering extracted records
- Type
- transformations
The transformations to be done on the records
- Type
List[RecordTransformation]
- config: Mapping[str, Any]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- record_filter: Optional[airbyte_cdk.sources.declarative.extractors.record_filter.RecordFilter] = None
- select_records(response: requests.models.Response, stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[airbyte_cdk.sources.declarative.types.Record]
Selects records from the response :param response: The response to select the records from :param stream_state: The stream state :param stream_slice: The stream slice :param next_page_token: The paginator token :return: List of Records selected from the response
- transformations: List[airbyte_cdk.sources.declarative.transformations.transformation.RecordTransformation]
Module contents
- class airbyte_cdk.sources.declarative.extractors.DpathExtractor(field_path: List[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]], config: Mapping[str, Any], parameters: dataclasses.InitVar[Mapping[str, Any]], decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder())
Bases:
airbyte_cdk.sources.declarative.extractors.record_extractor.RecordExtractor
Record extractor that searches a decoded response over a path defined as an array of fields.
If the field path points to an array, that array is returned. If the field path points to an object, that object is returned wrapped as an array. If the field path points to an empty object, an empty array is returned. If the field path points to a non-existing path, an empty array is returned.
Examples of instantiating this transform: ```
- extractor:
type: DpathExtractor field_path:
“root”
“data”
- field_path
Path to the field that should be extracted
- Type
Union[InterpolatedString, str]
- config: Mapping[str, Any]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- extract_records(response: requests.models.Response) List[Mapping[str, Any]]
Selects records from the response :param response: The response to extract the records from :return: List of Records extracted from the response
- field_path: List[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- class airbyte_cdk.sources.declarative.extractors.HttpSelector
Bases:
object
Responsible for translating an HTTP response into a list of records by extracting records from the response and optionally filtering records based on a heuristic.
- abstract select_records(response: requests.models.Response, stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[airbyte_cdk.sources.declarative.types.Record]
Selects records from the response :param response: The response to select the records from :param stream_state: The stream state :param stream_slice: The stream slice :param next_page_token: The paginator token :return: List of Records selected from the response
- class airbyte_cdk.sources.declarative.extractors.RecordFilter(parameters: dataclasses.InitVar[Mapping[str, Any]], config: Mapping[str, Any], condition: str = '')
Bases:
object
Filter applied on a list of Records
config (Config): The user-provided configuration as specified by the source’s spec condition (str): The string representing the predicate to filter a record. Records will be removed if evaluated to False
- condition: str = ''
- config: Mapping[str, Any]
- filter_records(records: List[Mapping[str, Any]], stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[Mapping[str, Any]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- class airbyte_cdk.sources.declarative.extractors.RecordSelector(extractor: airbyte_cdk.sources.declarative.extractors.record_extractor.RecordExtractor, config: typing.Mapping[str, typing.Any], parameters: dataclasses.InitVar[typing.Mapping[str, typing.Any]], record_filter: typing.Optional[airbyte_cdk.sources.declarative.extractors.record_filter.RecordFilter] = None, transformations: typing.List[airbyte_cdk.sources.declarative.transformations.transformation.RecordTransformation] = <factory>)
Bases:
airbyte_cdk.sources.declarative.extractors.http_selector.HttpSelector
Responsible for translating an HTTP response into a list of records by extracting records from the response and optionally filtering records based on a heuristic.
- extractor
The record extractor responsible for extracting records from a response
- Type
- record_filter
The record filter responsible for filtering extracted records
- Type
- transformations
The transformations to be done on the records
- Type
List[RecordTransformation]
- config: Mapping[str, Any]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- record_filter: Optional[airbyte_cdk.sources.declarative.extractors.record_filter.RecordFilter] = None
- select_records(response: requests.models.Response, stream_state: Mapping[str, Any], stream_slice: Optional[Mapping[str, Any]] = None, next_page_token: Optional[Mapping[str, Any]] = None) List[airbyte_cdk.sources.declarative.types.Record]
Selects records from the response :param response: The response to select the records from :param stream_state: The stream state :param stream_slice: The stream slice :param next_page_token: The paginator token :return: List of Records selected from the response
- transformations: List[airbyte_cdk.sources.declarative.transformations.transformation.RecordTransformation]