Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

prefect-airbyte

Welcome!

prefect-airbyte is a collections of prebuilt Prefect tasks that can be used to quickly construct Prefect flows.

Getting Started

Python setup

Requires an installation of Python 3.7+

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.

Installation

Install prefect-airbyte

pip install prefect-airbyte

Airbyte setup

See the airbyte documention on how to get your own instance.

Examples

Trigger a defined connection sync

from prefect import flow
from prefect_airbyte.connections import trigger_sync


@flow
def example_trigger_sync_flow():

      # Run other tasks and subflows here

      trigger_sync(
            connection_id="your-connection-id-to-sync",
            poll_interval_s=3,
            status_updates=True
      )

example_trigger_sync_flow()
❯ python airbyte_syncs.py
03:46:03 | prefect.engine - Created flow run 'thick-seahorse' for flow 'example_trigger_sync_flow'
03:46:03 | Flow run 'thick-seahorse' - Using task runner 'ConcurrentTaskRunner'
03:46:03 | Flow run 'thick-seahorse' - Created task run 'trigger_sync-35f0e9c2-0' for task 'trigger_sync'
03:46:03 | prefect - trigger airbyte connection: e1b2078f-882a-4f50-9942-cfe34b2d825b, poll interval 3 seconds
03:46:03 | prefect - pending
03:46:06 | prefect - running
03:46:09 | prefect - running
03:46:12 | prefect - running
03:46:16 | prefect - running
03:46:19 | prefect - running
03:46:22 | prefect - Job 26 succeeded.
03:46:22 | Task run 'trigger_sync-35f0e9c2-0' - Finished in state Completed(None)
03:46:22 | Flow run 'thick-seahorse' - Finished in state Completed('All states completed.')

Export an Airbyte instance's configuration

import gzip

from prefect import flow, task
from prefect_airbyte.configuration import export_configuration

@task
def zip_and_write_somewhere(
      airbyte_config: bytearray,
      somewhere: str,
):
    with gzip.open(somewhere, 'wb') as f:
        f.write(airbyte_config)

@flow
def example_export_configuration_flow(filepath: str):

    # Run other tasks and subflows here

    airbyte_config = export_configuration(
        airbyte_server_host="localhost",
        airbyte_server_port="8000",
        airbyte_api_version="v1",
    )

    zip_and_write_somewhere(
        somewhere=filepath,
        airbyte_config=airbyte_config
    )

if __name__ == "__main__":
    example_export_configuration_flow('*://**/my_destination.gz')

Resources

If you encounter and bugs while using prefect-airbyte, feel free to open an issue in the prefect-airbyte repository.

If you have any questions or issues while using prefect-airbyte, you can find help in either the Prefect Discourse forum or the Prefect Slack community

Development

If you'd like to install a version of prefect-airbyte for development, first clone the repository and then perform an editable install with pip:

git clone https://github.com/PrefectHQ/prefect-airbyte.git

cd prefect-airbyte/

pip install -e ".[dev]"

Metadata

Release files for prefect-airbyte 0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-airbyte 0b1
File Size Uploaded
prefect-airbyte-0b1.tar.gz 28.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-airbyte 0b1
File Interpreter ABI Platform
prefect_airbyte-0b1-py3-none-any.whl Python 3 none any Details

Total release size: 41.5 kB

Release files / prefect-airbyte-0b1.tar.gz

Download URL prefect-airbyte-0b1.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
31a7b856105d6b78e307a8d107c16418411bf8b8817f4eddd051e7217c571610
BLAKE2b-256 checksum
How to use checksums
31c6a29e2ffda5832e25a02eb1db91ededda16785aa2ec3c7fe457a05f00df01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release files / prefect_airbyte-0b1-py3-none-any.whl

Download URL prefect_airbyte-0b1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7334bb540d4e87d18ca41dfc06be04a9ef6171957c0c006cfd739aaf107d044d
BLAKE2b-256 checksum
How to use checksums
cb1af69fa4e9cbc1f2601736b0704510b11dc159240719868df4dd2c47e5ecd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0

2 release files

This release

0b1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page