[docs]classAirbyteCDKLoader(BaseLoader):"""Load with an `Airbyte` source connector implemented using the `CDK`."""
[docs]def__init__(self,config:Mapping[str,Any],source_class:Any,stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. source_class: The source connector class. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """fromairbyte_cdk.models.airbyte_protocolimportAirbyteRecordMessagefromairbyte_cdk.sources.embedded.base_integrationimport(BaseEmbeddedIntegration,)fromairbyte_cdk.sources.embedded.runnerimportCDKRunnerclassCDKIntegration(BaseEmbeddedIntegration):"""A wrapper around the CDK integration."""def_handle_record(self,record:AirbyteRecordMessage,id:Optional[str])->Document:ifrecord_handler:returnrecord_handler(record,id)returnDocument(page_content="",metadata=record.data)self._integration=CDKIntegration(config=config,runner=CDKRunner(source=source_class(),name=source_class.__name__),)self._stream_name=stream_nameself._state=state
[docs]classAirbyteHubspotLoader(AirbyteCDKLoader):"""Load from `Hubspot` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_hubspot",pip_name="airbyte-source-hubspot").SourceHubspotsuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteStripeLoader(AirbyteCDKLoader):"""Load from `Stripe` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_stripe",pip_name="airbyte-source-stripe").SourceStripesuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteTypeformLoader(AirbyteCDKLoader):"""Load from `Typeform` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_typeform",pip_name="airbyte-source-typeform").SourceTypeformsuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteZendeskSupportLoader(AirbyteCDKLoader):"""Load from `Zendesk Support` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_zendesk_support",pip_name="airbyte-source-zendesk-support").SourceZendeskSupportsuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteShopifyLoader(AirbyteCDKLoader):"""Load from `Shopify` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_shopify",pip_name="airbyte-source-shopify").SourceShopifysuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteSalesforceLoader(AirbyteCDKLoader):"""Load from `Salesforce` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_salesforce",pip_name="airbyte-source-salesforce").SourceSalesforcesuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)
[docs]classAirbyteGongLoader(AirbyteCDKLoader):"""Load from `Gong` using an `Airbyte` source connector."""
[docs]def__init__(self,config:Mapping[str,Any],stream_name:str,record_handler:Optional[RecordHandler]=None,state:Optional[Any]=None,)->None:"""Initializes the loader. Args: config: The config to pass to the source connector. stream_name: The name of the stream to load. record_handler: A function that takes in a record and an optional id and returns a Document. If None, the record will be used as the document. Defaults to None. state: The state to pass to the source connector. Defaults to None. """source_class=guard_import("source_gong",pip_name="airbyte-source-gong").SourceGongsuper().__init__(config=config,source_class=source_class,stream_name=stream_name,record_handler=record_handler,state=state,)