Project Structure Recommendation
When developing a connector with the Fivetran Connector SDK, we recommend the following project structure to ensure smooth local development, debugging, and deployment:
project_name/
├── myenv/ # (Optional) Local virtual environment directory
├── connector.py # Main connector script
├── requirements.txt # Dependency file for pip (or use pyproject.toml instead)
├── pyproject.toml # (Optional alternative to requirements.txt) PEP 518/517 dependency file
├── configuration.json # (Optional) File for passing configuration parameters, such as credentials during connector deployment
├── .gitignore # (Optional) File listing files and folders to ignore during packaging and deployment
├── AGENTS.md # (Optional) Instruction file for your AI agents
Guidelines
- Place
connector.pyand your dependency file (requirements.txtorpyproject.toml) directly in the project root. If both are present,pyproject.tomltakes precedence. - If you use a local Python virtual environment (for example,
myenv/), store it in a separate folder within your project. - If you create a
configuration.jsonfile in the project, remember to add it to.gitignoreto avoid committing sensitive credentials. - Always run
fivetran debug,fivetran resetandfivetran deploycommands from the project root — the same directory that containsconnector.py. - An optional
.gitignorefile allows you to define the list of ignored files when we package and deploy code. It uses the standard.gitignorepattern format. Use it to exclude files from your project directory that don't need to be part of the deployed connector. - An optional
AGENTS.mdfile can be included to provide instructions for any AI agents you may be using in your connector development. Depending on your use cases, you can place your AI agent instructions files in the project root, a dedicated subdirectory, or outside of the project directory. - If you have multiple Python files for your project, consider organizing them into a subdirectory (for example,
src/orutils/) and adjusting your import statements accordingly. Ensure the mainconnector.pyfile remains in the project's root for compatibility with the Connector SDK project structure. Refer to this example for more details.
This setup supports better compatibility with IDE tooling and ensures that the Connector SDK runtime environment properly locates your scripts and dependencies.