Submodules
airbyte_cdk.sources.declarative.requesters.paginators.strategies.cursor_pagination_strategy module
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.cursor_pagination_strategy.CursorPaginationStrategy(cursor_value: Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str], config: Mapping[str, Any], parameters: dataclasses.InitVar[Mapping[str, Any]], page_size: Optional[int] = None, stop_condition: Optional[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_boolean.InterpolatedBoolean, str]] = None, decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder())
-
Pagination strategy that evaluates an interpolated string to define the next page token
- page_size
the number of records to request
- Type
Optional[int]
- cursor_value
template string evaluating to the cursor value
- Type
Union[InterpolatedString, str]
- stop_condition
template string evaluating when to stop paginating
- Type
Optional[InterpolatedBoolean]
- config: Mapping[str, Any]
- cursor_value: Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[int] = None
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
- stop_condition: Optional[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_boolean.InterpolatedBoolean, str]] = None
airbyte_cdk.sources.declarative.requesters.paginators.strategies.offset_increment module
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.offset_increment.OffsetIncrement(config: Mapping[str, Any], page_size: Optional[Union[str, int]], parameters: dataclasses.InitVar[Mapping[str, Any]], decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder(), inject_on_first_request: bool = False)
-
Pagination strategy that returns the number of records reads so far and returns it as the next page token .. rubric:: Examples
# page_size to be a constant integer value pagination_strategy:
type: OffsetIncrement page_size: 2
# page_size to be a constant string value pagination_strategy:
type: OffsetIncrement page_size: “2”
# page_size to be an interpolated string value pagination_strategy:
type: OffsetIncrement page_size: “{{ parameters[‘items_per_page’] }}”
- page_size
the number of records to request
- Type
- config: Mapping[str, Any]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- inject_on_first_request: bool = False
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[Union[str, int]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
airbyte_cdk.sources.declarative.requesters.paginators.strategies.page_increment module
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.page_increment.PageIncrement(page_size: Optional[int], parameters: dataclasses.InitVar[Mapping[str, Any]], start_from_page: int = 0, inject_on_first_request: bool = False)
-
Pagination strategy that returns the number of pages reads so far and returns it as the next page token
- page_size
the number of records to request
- Type
int
- start_from_page
number of the initial page
- Type
int
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- inject_on_first_request: bool = False
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[int]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
- start_from_page: int = 0
airbyte_cdk.sources.declarative.requesters.paginators.strategies.pagination_strategy module
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.pagination_strategy.PaginationStrategy
Bases:
object
Defines how to get the next page token
- abstract get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- abstract property initial_token: Optional[Any]
Return the initial value of the token
- abstract next_page_token(response: requests.models.Response, last_records: List[airbyte_cdk.sources.declarative.types.Record]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- abstract reset() None
Reset the pagination’s inner state
Module contents
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.CursorPaginationStrategy(cursor_value: Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str], config: Mapping[str, Any], parameters: dataclasses.InitVar[Mapping[str, Any]], page_size: Optional[int] = None, stop_condition: Optional[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_boolean.InterpolatedBoolean, str]] = None, decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder())
-
Pagination strategy that evaluates an interpolated string to define the next page token
- page_size
the number of records to request
- Type
Optional[int]
- cursor_value
template string evaluating to the cursor value
- Type
Union[InterpolatedString, str]
- stop_condition
template string evaluating when to stop paginating
- Type
Optional[InterpolatedBoolean]
- config: Mapping[str, Any]
- cursor_value: Union[airbyte_cdk.sources.declarative.interpolation.interpolated_string.InterpolatedString, str]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[int] = None
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
- stop_condition: Optional[Union[airbyte_cdk.sources.declarative.interpolation.interpolated_boolean.InterpolatedBoolean, str]] = None
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.CursorStopCondition(cursor: airbyte_cdk.sources.declarative.incremental.cursor.Cursor)
Bases:
airbyte_cdk.sources.declarative.requesters.paginators.strategies.stop_condition.PaginationStopCondition
- is_met(record: airbyte_cdk.sources.declarative.types.Record) bool
Given a condition is met, the pagination will stop
- Parameters
record – a record used to evaluate the condition
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.OffsetIncrement(config: Mapping[str, Any], page_size: Optional[Union[str, int]], parameters: dataclasses.InitVar[Mapping[str, Any]], decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder(), inject_on_first_request: bool = False)
-
Pagination strategy that returns the number of records reads so far and returns it as the next page token .. rubric:: Examples
# page_size to be a constant integer value pagination_strategy:
type: OffsetIncrement page_size: 2
# page_size to be a constant string value pagination_strategy:
type: OffsetIncrement page_size: “2”
# page_size to be an interpolated string value pagination_strategy:
type: OffsetIncrement page_size: “{{ parameters[‘items_per_page’] }}”
- page_size
the number of records to request
- Type
- config: Mapping[str, Any]
- decoder: airbyte_cdk.sources.declarative.decoders.decoder.Decoder = JsonDecoder()
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- inject_on_first_request: bool = False
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[Union[str, int]]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.PageIncrement(page_size: Optional[int], parameters: dataclasses.InitVar[Mapping[str, Any]], start_from_page: int = 0, inject_on_first_request: bool = False)
-
Pagination strategy that returns the number of pages reads so far and returns it as the next page token
- page_size
the number of records to request
- Type
int
- start_from_page
number of the initial page
- Type
int
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- inject_on_first_request: bool = False
- next_page_token(response: requests.models.Response, last_records: List[Mapping[str, Any]]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- page_size: Optional[int]
- parameters: dataclasses.InitVar[Mapping[str, Any]]
- reset()
Reset the pagination’s inner state
- start_from_page: int = 0
- class airbyte_cdk.sources.declarative.requesters.paginators.strategies.StopConditionPaginationStrategyDecorator(_delegate: airbyte_cdk.sources.declarative.requesters.paginators.strategies.pagination_strategy.PaginationStrategy, stop_condition: airbyte_cdk.sources.declarative.requesters.paginators.strategies.stop_condition.PaginationStopCondition)
-
- get_page_size() Optional[int]
- Returns
page size: The number of records to fetch in a page. Returns None if unspecified
- property initial_token: Optional[Any]
Return the initial value of the token
- next_page_token(response: requests.models.Response, last_records: List[airbyte_cdk.sources.declarative.types.Record]) Optional[Any]
- Parameters
response – response to process
last_records – records extracted from the response
- Returns
next page token. Returns None if there are no more pages to fetch
- reset() None
Reset the pagination’s inner state