You need to have installed the following before you begin:
- Python (version >= 3.9)
- Docker Desktop (version >= 4.23.0)
Create a virtual environment and install Fivetran Connector SDK package from PyPI:
pip install fivetran-connector-sdk
- Create a folder for your project with a
connector.py
file to contain your connector code. Tip: Use one of the examples in the/examples
folder as a template.
cd <project-folder-path>
- Write your connector.
- The following command will debug your project locally on your computer:
fivetran debug
- If you'd like to debug your project in an IDE, add the following code block to
connector.py
file:
if __name__ == "__main__":
connector.debug()
- When you run
connector.py
in your local environment, your connector will sync and generate files in<project-folder-path>/files
. Once the sync is done running, it will persist the records inwarehouse.db
file. This is an instance of DuckDB database. You can connect to it to validate the results of your sync using DuckDB CLI or DBeaver.
Use the following command to deploy your project to Fivetran:
fivetran deploy --deploy-key <DEPLOY-KEY> --group <GROUP-NAME> --connection <CONNECTION-NAME>
DEPLOY-KEY
is your regular Fivetran API key
If your connector uses configuration include it when you deploy your connection like this:
fivetran deploy --deploy-key <DEPLOY-KEY> --group <GROUP-NAME> --connection <CONNECTION-NAME> --configuration "{\"KEY\":\"VALUE\"}"
There are several examples available under /examples
:
Simplest example, append-only
Emulated source, without any calls out to the internet
Declares a schema and upserts all data types
Upserts all data types without specifying a schema
Shows how to use upsert, update and delete operations
A realistic example, using a public API, fetching data from NOAA
Shows how to use secrets