Skip to main content

PyAirbyte

Project description

PyAirbyte

PyAirbyte brings the power of Airbyte to every Python developer.

Secrets Management

PyAirbyte can auto-import secrets from the following sources:

  1. Environment variables.
  2. Variables defined in a local .env ("Dotenv") file.
  3. Google Colab secrets.
  4. Manual entry via getpass.

Note: Additional secret store options may be supported in the future. More info here.

Retrieving Secrets

from airbyte import get_secret, SecretSource

source = get_connection("source-github")
source.set_config(
   "credentials": {
      "personal_access_token": get_secret("GITHUB_PERSONAL_ACCESS_TOKEN"),
   }
)

The get_secret() function accepts an optional source argument of enum type SecretSource. If omitted or set to SecretSource.ANY, PyAirbyte will search all available secrets sources. If source is set to a specific source, then only that source will be checked. If a list of SecretSource entries is passed, then the sources will be checked using the provided ordering.

By default, PyAirbyte will prompt the user for any requested secrets that are not provided via other secret managers. You can disable this prompt by passing prompt=False to get_secret().

Connector compatibility

To make a connector compatible with PyAirbyte, the following requirements must be met:

  • The connector must be a Python package, with a pyproject.toml or a setup.py file.
  • In the package, there must be a run.py file that contains a run method. This method should read arguments from the command line, and run the connector with them, outputting messages to stdout.
  • The pyproject.toml or setup.py file must specify a command line entry point for the run method called source-<connector name>. This is usually done by adding a console_scripts section to the pyproject.toml file, or a entry_points section to the setup.py file. For example:
[tool.poetry.scripts]
source-my-connector = "my_connector.run:run"
setup(
    ...
    entry_points={
        'console_scripts': [
            'source-my-connector = my_connector.run:run',
        ],
    },
    ...
)

To publish a connector to PyPI, specify the pypi section in the metadata.yaml file. For example:

data:
 # ...
 remoteRegistries:
   pypi:
     enabled: true
     packageName: "airbyte-source-my-connector"

Validating source connectors

To validate a source connector for compliance, the airbyte-lib-validate-source script can be used. It can be used like this:

airbyte-lib-validate-source —connector-dir . -—sample-config secrets/config.json

The script will install the python package in the provided directory, and run the connector against the provided config. The config should be a valid JSON file, with the same structure as the one that would be provided to the connector in Airbyte. The script will exit with a non-zero exit code if the connector fails to run.

For a more lightweight check, the --validate-install-only flag can be used. This will only check that the connector can be installed and returns a spec, no sample config required.

Contributing

To learn how you can contribute to PyAirbyte, please see our PyAirbyte Contributors Guide.

Changelog and Release Notes

For a version history and list of all changes, please see our GitHub Releases page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airbyte-0.7.2.tar.gz (58.9 kB view details)

Uploaded Source

Built Distribution

airbyte-0.7.2-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

Details for the file airbyte-0.7.2.tar.gz.

File metadata

  • Download URL: airbyte-0.7.2.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for airbyte-0.7.2.tar.gz
Algorithm Hash digest
SHA256 ec513d40dc4dfc69441eb882dc024ccdc916fe94f7ba3e245900a2c3976683b2
MD5 6be5d146f33f62d59391542cff8b2329
BLAKE2b-256 98e6224dbcd11fa8770282a37658d92a07e60823d855863b3d557b23172c9e3d

See more details on using hashes here.

File details

Details for the file airbyte-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: airbyte-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 77.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for airbyte-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a6d320d6aad3eb3f58d15a0b6b7252d8d20db9c1e0f6780fa880e28bd42bf3a
MD5 983c55f5a501a587a0f3ff0b7dd96db3
BLAKE2b-256 ffe8c8a24ab64b514429dcaca0838c09fcf4a1aeca92a9736897aed1e49af9a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page