How can I access the python cdk to create a connec...
# ask-ai
j
How can I access the python cdk to create a connector?
k
To access the Python CDK for creating an Airbyte connector, you should install the
airbyte-cdk
CLI, which is part of the Airbyte Python CDK toolkit. Here’s how you can get started: 1. Install
uv
(a Python package manager), following the instructions in the Airbyte documentation. 2. Install or upgrade the Airbyte CDK CLI by running:
Copy code
uv tool install --upgrade 'airbyte-cdk[dev]'
3. Verify the installation and explore available commands with:
Copy code
airbyte-cdk --help
The Python CDK provides a framework for rapidly developing production-grade Airbyte connectors, especially for HTTP APIs and generic Python sources. You can use it as a dependency in your Python project for advanced customization beyond what the Connector Builder offers. For more details and reference documentation, see the [Airbyte Python CDK documentation](https://airbytehq.github.io/airbyte-python-cdk/airbyte_cdk.html) and the [official Airbyte docs](https://docs.airbyte.com/platform/connector-development/local-connector-development#airbyte-connector-development-kits-cdks). If you’re new to connector development, it’s recommended to start with the Connector Builder, and only use the Python CDK if you need more flexibility or customization than the Builder provides. You can find a complete tutorial for implementing an HTTP source connector in the [Airbyte documentation](https://docs.airbyte.com/platform/connector-development/tutorials/custom-python-connector/getting-started) as well. For further guidance, refer to the official documentation: - [Airbyte CDK CLI installation and usage](https://docs.airbyte.com/platform/connector-development/local-connector-development#airbyte-connector-development-kits-cdks) - [Python CDK concepts and tutorials](https://docs.airbyte.com/platform/connector-development/cdk-python)
j
@kapa.ai how would I be able to get Airbyte to accept a connector built via the python CDK?
k
A message from kapa.ai
To get Airbyte to accept a connector built via the Python CDK, you need to package your connector as a Docker image and then register it with your Airbyte instance. Here’s a high-level overview of the process: 1. Develop your connector using the Python CDK, following the standard structure (including implementing the required entrypoints:
spec
,
check
,
discover
, and
read
) and ensuring you have a valid
metadata.yaml
file in the root of your connector directory. 2. Build the Docker image for your connector. This is typically done using Airbyte’s tooling (e.g.,
airbyte-ci connectors --name source-<source-name> build
), which will create a Docker image like
airbyte/source-<source-name>:dev
in your local Docker host. 3. Register the connector with Airbyte: - If you are running Airbyte locally, you can load the Docker image into your Airbyte instance (for example, using
kind load docker-image ...
if using Kubernetes). - In the Airbyte UI, go to Workspace settings > Sources or Destinations (depending on your connector type), then click New connector > Add a new Docker connector. - Enter the Docker image name and tag, and optionally provide documentation. - Click Add to save the configuration. Your connector will now be available for use in Airbyte connections. 4. (Optional) If you update the connector’s specification, you may need to clear the connector specification cache in Airbyte by re-saving the connector settings in the UI to ensure the new spec is registered. For more detailed, step-by-step instructions, see the official documentation: - [Uploading Docker-based custom connectors](https://docs.airbyte.com/platform/operator-guides/using-custom-connectors#4-use-your-custom-docker-connector-in-airbyte) - [Developing and testing connectors locally](https://docs.airbyte.com/platform/1.8/contributing-to-airbyte/developing-locally#connector-contributions) This process ensures that Airbyte recognizes and can use your custom Python CDK connector just like any other connector in the platform.
j
@kapa.ai so if I wanted to create a connector via the python CDK with APIs that require custom logic for: 1. Asynchronous polling (a trigger -> poll -> fetch workflow) 2. Complex batch handling (array-based JSON request bodies) 3. Multi-endpoint orchestration to deliver data
k
A message from kapa.ai
Yes, you can create a connector via the Python CDK that implements custom logic for asynchronous polling, complex batch handling, and multi-endpoint orchestration. The Airbyte Python CDK is designed to be highly flexible and allows you to override or extend its base classes to handle advanced API behaviors. Here’s how the CDK supports these scenarios: 1. Asynchronous Polling (Trigger → Poll → Fetch Workflow): - The Python CDK allows you to fully customize the logic of your connector by subclassing and overriding methods in the base classes (such as
HTTPStream
). You can implement custom polling logic by controlling the request/response cycle and state management in your stream classes. The CDK does not restrict you to synchronous or simple request/response patterns, so you can implement polling and trigger-based workflows as needed. - If you need to go beyond the built-in capabilities, you can use [Custom Components](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/custom-components) to inject your own Python code for specialized behaviors, including asynchronous polling. 2. Complex Batch Handling (Array-based JSON Request Bodies): - The CDK’s HTTP stream classes allow you to customize the request body and handle batch requests. You can override methods to construct array-based JSON payloads and process batch responses as required by your API. - Custom Components can also be used to implement specialized request/response handling logic if the standard CDK methods are not sufficient. 3. Multi-endpoint Orchestration: - The CDK supports defining multiple streams, each corresponding to a different endpoint. You can orchestrate data fetching across these streams, including handling dependencies (e.g., fetching data from one endpoint to use as input for another). - The [Custom Components](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/custom-components) feature allows you to implement orchestration logic that coordinates multiple endpoints, handles complex workflows, and manages data dependencies. Summary: The Airbyte Python CDK is designed for extensibility and can handle advanced use cases like asynchronous polling, batch processing, and multi-endpoint orchestration by allowing you to override and extend its base classes or by using Custom Components for even more control. This approach lets you implement virtually any API integration pattern required by your use case. For more details, see the documentation on [Custom Components for the Connector Builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/custom-components) and the [Python CDK overview](https://docs.airbyte.com/platform/connector-development/cdk-python) for guidance on extending and customizing connector logic.
j
@kapa.ai how do i go about authorization and integration of the connector once ready?
k
A message from kapa.ai
To authorize and integrate your custom connector built with the Python CDK into Airbyte, follow these steps: ### 1. Authorization - Choose the appropriate authentication method for your API. The Airbyte Python CDK supports Basic and OAuth2.0 authentication via the
TokenAuthenticator
and
Oauth2Authenticator
classes. Both place the API token in the
Authorization
header. The
Oauth2Authenticator
also supports refreshing access tokens with a refresh token, but does not handle the full OAuth2.0 loop (i.e., user consent flow) out of the box. You can pass the authenticator instance to your
HTTPStream
class in your connector code [see details](https://docs.airbyte.com/platform/next/connector-development/cdk-python/http-streams#authentication). - If your API uses OAuth2.0 and you want to support the full authorization flow (including user consent and token refresh), you should implement the [Declarative OAuth Connector Specification](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/authentication#oauth-2). This allows Airbyte to handle the OAuth flow, including redirecting users for consent and exchanging authorization codes for tokens. - For APIs that require custom headers (e.g.,
X-API-KEY
), you can implement custom authentication logic in your connector code by overriding the relevant methods or using the appropriate authenticator class. ### 2. Integration into Airbyte - Build your connector as a Docker image. This is the standard way Airbyte runs connectors. - Register the connector in Airbyte: - In the Airbyte UI, go to Workspace settings > Sources or Destinations (depending on your connector type). - Click New connector > Add a new Docker connector. - Enter the Docker image name and tag. - Save the configuration. - Configure authentication in the Airbyte UI: - When setting up a new connection using your connector, Airbyte will prompt you for the required authentication fields (e.g., API key, OAuth client ID/secret, etc.) as defined in your connector’s
spec
. - For OAuth connectors: - If using Airbyte Cloud and the connector supports declarative OAuth, Airbyte manages the client credentials and handles the OAuth flow for you. - For custom or self-managed connectors, you must register your own OAuth app with the third-party API to obtain a Client ID and Client Secret, then enter these in the Airbyte UI when configuring the connector. Make sure the redirect URI registered with the third-party matches the one provided by Airbyte [see details](https://docs.airbyte.com/platform/next/using-airbyte/oauth). Troubleshooting tips: - If you encounter issues with OAuth, check for invalid credentials, expired tokens, or redirect URI mismatches as described in the [OAuth troubleshooting guide](https://docs.airbyte.com/platform/next/using-airbyte/oauth). Summary: - Implement authentication in your connector code using the Python CDK’s authenticator classes or custom logic. - Build and register your connector as a Docker image in Airbyte. - Configure authentication in the Airbyte UI when setting up a connection. - For OAuth, ensure proper client credential management and redirect URI configuration. For more details, refer to the [CDK authentication documentation](https://docs.airbyte.com/platform/next/connector-development/cdk-python/http-streams#authentication) and [OAuth integration guide](https://docs.airbyte.com/platform/next/using-airbyte/oauth).
j
@kapa.ai I understand that I might be limited according to Airbyte's acceptable contributions? Is this true, would my new connector not be accepted and integrated?
k
A message from kapa.ai
Yes, Airbyte does have specific guidelines and limitations regarding acceptable community contributions, especially for new connectors. According to the most recent documentation, Airbyte currently accepts the following types of connector contributions: - Fixes and enhancements to existing API source connectors. - New streams and features for existing connectors using the Connector Builder/YAML. - New API source connectors built with the Connector Builder. - Migrations of existing connectors from Python to the Connector Builder/YAML. Airbyte is not currently accepting new Java connectors, as they are revamping the core Java destinations codebase. Additionally, platform contributions are not accepted; Airbyte will stop accepting community contributions to the platform itself in mid-2025. Contributions outside the listed scope are evaluated on a case-by-case basis, and you are encouraged to reach out to the Airbyte team before starting to ensure your idea can be accepted. If your new connector is built with the Python CDK and fits within these guidelines (for example, as a new API source or a migration to the Connector Builder), it is likely to be accepted. However, if your contribution falls outside these categories, you should contact the Airbyte team to confirm acceptance before investing significant effort. This helps avoid situations where your connector might not be integrated due to current contribution policies [see details](https://docs.airbyte.com/platform/1.8/contributing-to-airbyte)[^1]. [^1]: [Contributing to Airbyte](https://docs.airbyte.com/platform/1.8/contributing-to-airbyte)
j
@kapa.ai what is the best way of contacting the Airbyte team to receive approval before development? As we fall outside these guidelines
k
A message from kapa.ai
The best way to contact the Airbyte team for approval before starting development—especially if your contribution falls outside the standard guidelines—is to reach out via the [community Slack](https://slack.airbyte.io) and post your question or proposal in the
#dev-and-contribuions
channel. This is explicitly recommended for contributors who want to clarify whether their idea will be accepted before investing significant effort. You can also start a [GitHub Discussion](https://github.com/airbytehq/airbyte/discussions) to propose your idea and get feedback from the team and community. If you do not receive an update, you are encouraged to ping the team on Slack for a response [Contributing to Airbyte](https://docs.airbyte.com/platform/1.8/contributing-to-airbyte). This approach ensures you get direct feedback and approval from the Airbyte maintainers before proceeding.
j
@kapa.ai are you sure that channel exists? I can't seem to find it. In addition, what is the expected response rate for my inquiry? Lastly, can you offer a proposed message to send to the channel regarding my request?
k
A message from kapa.ai
You are correct to question the existence of the
#dev-and-contribuions
channel. According to the official Airbyte documentation, contributors are directed to reach out in the [
#dev-and-contribuions
channel](https://airbytehq.slack.com/archives/C054V9JFTC6) on the Airbyte community Slack for contribution-related questions. However, there is a known typo in the channel name ("contribuions" instead of "contributions"), and there has been a [reported issue](https://github.com/airbytehq/airbyte/issues/65188) about this typo. The documentation still references this channel, but it is possible that the channel name or its purpose may have changed, or that it is not visible to all users. If you cannot find the channel, you can still join the [Airbyte community Slack](https://slack.airbyte.com) and look for other relevant channels such as
#ask-community-for-troubleshooting
or ask in a general channel for guidance on where to post contribution-related questions. Expected response rate: The documentation does not specify an exact response time for inquiries in Slack. However, it does mention that connector contributions may take some time to review and encourages patience. If you do not receive an update on your inquiry, you are advised to ping the team again on Slack for a response [Contributing to Airbyte](https://docs.airbyte.com/platform/1.8/contributing-to-airbyte). Proposed message to send in the channel:
Copy code
Hi Airbyte team,  I am interested in contributing a new connector that may fall outside the current contribution guidelines. Could you please advise if this type of contribution would be accepted, or if there are any special considerations I should be aware of before starting development? Thank you!
If you are unable to find the specific channel, you can use this message in a general or support channel and ask to be directed to the appropriate place for contribution discussions. Note: The knowledge sources do not provide further details about the current status or visibility of the
#dev-and-contribuions
channel, so if you cannot find it, reaching out in another active community channel is recommended.