{"id":1326,"library":"apache-airflow-providers-ftp","title":"Apache Airflow FTP Provider","description":"The `apache-airflow-providers-ftp` package provides operators and hooks to interact with FTP and FTPS servers within Apache Airflow DAGs. It enables tasks like uploading, downloading, and deleting files from remote FTP/FTPS locations. The current version is 3.14.2, and provider packages release independently from core Airflow, typically for bug fixes, new features, or compatibility with new Airflow versions.","status":"active","version":"3.14.2","language":"python","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/ftp","tags":["Airflow","FTP","FTPS","Provider","DAG","ETL","File Transfer"],"install":[{"cmd":"pip install apache-airflow-providers-ftp","lang":"bash","label":"Install FTP Provider"}],"dependencies":[{"reason":"This is an Airflow provider and requires Apache Airflow to run.","package":"apache-airflow","optional":false}],"imports":[{"wrong":"from airflow.providers.ftp.operators.ftp import FTPOperator","symbol":"FTPOperator","correct":"from airflow.providers.ftp.operators.ftp import FTPOperator"}],"quickstart":{"code":"from __future__ import annotations\n\nimport pendulum\n\nfrom airflow.decorators import dag\nfrom airflow.operators.bash import BashOperator\nfrom apache_airflow_providers_ftp.operators.ftp import FTPOperator\n\n# Ensure you have an FTP connection configured in Airflow UI (Admin -> Connections)\n# with conn_id='ftp_default'.\n# Set: Conn Id = ftp_default, Conn Type = FTP\n# Host: your_ftp_host (e.g., 'localhost' or 'ftp.example.com')\n# Port: 21 (or 22 for SFTP if using an SFTP provider, 990 for implicit FTPS)\n# Login: your_username\n# Password: your_password\n\n@dag(\n    dag_id=\"ftp_example_dag\",\n    start_date=pendulum.datetime(2023, 10, 26, tz=\"UTC\"),\n    catchup=False,\n    schedule=None,\n    tags=[\"ftp\", \"example\", \"provider\"],\n)\ndef ftp_dag():\n    # Create a dummy local file to upload\n    create_local_file = BashOperator(\n        task_id=\"create_local_file\",\n        bash_command=\"echo 'Hello from Airflow FTP provider!' > /tmp/airflow_ftp_test.txt\"\n    )\n\n    # Upload the file to FTP\n    upload_file_to_ftp = FTPOperator(\n        task_id=\"upload_file_to_ftp\",\n        ftp_conn_id=\"ftp_default\",\n        local_filepath=\"/tmp/airflow_ftp_test.txt\",\n        remote_filepath=\"/remote_airflow_test.txt\",\n        operation=\"put\", # 'put' (upload), 'get' (download), 'delete' (delete remote)\n        create_intermediate_dirs=True,\n    )\n\n    # Clean up the local dummy file\n    clean_local_file = BashOperator(\n        task_id=\"clean_local_file\",\n        bash_command=\"rm /tmp/airflow_ftp_test.txt\"\n    )\n\n    create_local_file >> upload_file_to_ftp >> clean_local_file\n\nftp_dag()\n","lang":"python","description":"This quickstart defines an Airflow DAG that demonstrates uploading a file to an FTP server using the `FTPOperator`. It first creates a local dummy file, then uploads it to the configured FTP server, and finally cleans up the local file. Remember to configure an 'FTP' type connection in the Airflow UI with `conn_id='ftp_default'` and appropriate host, login, and password."},"warnings":[{"fix":"In Airflow UI (Admin -> Connections), create a connection with 'Conn Type' explicitly set to 'FTP'. Ensure 'Host', 'Port', 'Login', and 'Password' fields are correctly filled. For FTPS, specify parameters like `explicit_ftp` and `ssl_context_kw` in the 'Extra' field as JSON.","message":"Incorrect Airflow connection configuration for FTP/FTPS. Users often use a generic 'HTTP' or 'SFTP' connection type, or fail to set the 'Conn Type' to 'FTP' for FTP/FTPS operations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For FTPS, use `FTPSFileTransferOperator` or `FTPSHook`. Configure the Airflow connection's 'Extra' field with JSON parameters like `{\"explicit_ftp\": true}` for explicit FTPS, or specific `ssl_context_kw` for advanced SSL settings. The port for FTPS is typically 21 for explicit or 990 for implicit.","message":"Distinction between FTP and FTPS, and explicit vs. implicit FTPS. The `FTPOperator` and `FTPHook` default to FTP. For FTPS, you must use `FTPSFileTransferOperator` or `FTPSHook` and configure the connection accordingly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"The `FTPOperator` and `FTPSFileTransferOperator` have a `transfer_mode` parameter (default is 'binary'). Explicitly set `transfer_mode='ascii'` when dealing with plain text files to ensure correct line ending handling during transfer.","message":"File transfer mode (binary vs. ASCII). Issues can arise when transferring text files in binary mode, or vice versa, especially across different operating systems with varying line endings.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider implementing retries for your Airflow tasks. For longer timeouts, you might need to specify a `timeout` parameter when initializing the Hook (e.g., `FTPHook(ftp_conn_id, timeout=300)`). If not directly exposed by the operator, you might need to extend the hook or pass it via the 'Extra' field of the Airflow connection if supported by the underlying library.","message":"Large file transfers may encounter network timeouts, leading to task failures. The default FTP connection timeout might be too short for very large files or slow networks.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install the provider package using pip: `pip install apache-airflow-providers-ftp`. If you're using a containerized Airflow setup (e.g., Docker, Kubernetes), ensure this command is included in your `Dockerfile` or entrypoint script to install the provider into the Airflow environment.","message":"The `apache-airflow-providers-ftp` package is not installed, leading to a `ModuleNotFoundError`. The Python environment running the Airflow DAG or script does not have the necessary provider installed.","severity":"breaking","affected_versions":"All versions"},{"fix":"Ensure the `apache-airflow-providers-ftp` package is installed in your Airflow environment using `pip install apache-airflow-providers-ftp`. Verify that the import statement `from apache_airflow_providers_ftp.operators.ftp import FTPOperator` (or similar) is correct and matches the installed package structure.","message":"The `apache-airflow-providers-ftp` library (or its specific components like `apache_airflow_providers_ftp.operators.ftp`) could not be found. This often indicates the provider package is not installed in the Airflow environment, or there's a typo in the import path.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'3.14.2':44 'airflow':2,8,25,52,63,65 'apach':1,7,24 'apache-airflow-providers-ftp':6 'bug':55 'compat':60 'core':51 'current':41 'dag':26,69 'delet':34 'download':32 'enabl':28 'etl':70 'featur':58 'file':35,71 'fix':56 'ftp':3,10,19,66 'ftp/ftps':38 'ftps':21,67 'hook':15 'independ':49 'interact':17 'like':30 'locat':39 'new':57,62 'oper':13 'packag':11,47 'provid':4,9,12,46,68 'releas':48 'remot':37 'server':22 'task':29 'transfer':72 'typic':53 'upload':31 'version':42,64 'within':23","created_at":"2026-04-09T03:43:07.486089+00:00","updated_at":"2026-04-15T20:31:25.659013+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'FTPOperator' from 'airflow.providers.ftp.operators.ftp' (/tmp/tmp6b3nqrhh/venv/lib/python3.12/site-packages/airflow/providers/ftp/operators/ftp.py). Did you mean: 'FTPOperation'?"},"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.15.0","cli_name":"airflow","cli_version":"","type":"library","homepage":"https://airflow.apache.org/docs/apache-airflow-providers-ftp/","github":"https://github.com/apache/airflow","docs":"https://airflow.apache.org/docs/apache-airflow-providers-ftp/3.14.3","changelog":"https://airflow.apache.org/docs/apache-airflow-providers-ftp/3.14.3/changelog.html","pypi":"https://pypi.org/project/apache-airflow-providers-ftp/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["workflow","data","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":"stale"}}