Ctrl + K
DocumentationLog inGet started

tessl/pypi-apache-airflow-providers-ftp

tessl install tessl/pypi-apache-airflow-providers-ftp@3.13.0

Provider package for Apache Airflow that enables FTP file transfer protocol operations including hooks, operators, and sensors for workflow integration.

Agent Success

Agent success rate when using this tile

84%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.06x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-7/

FTP Directory Metadata Extractor

Build a tool that connects to an FTP server and retrieves detailed metadata about files and directories in a specified remote path. The tool should extract structured information about each item including its type, size, and timestamps.

Requirements

Create a Python module that implements a function to retrieve structured directory listings from an FTP server. The function should:

  1. Accept an FTP connection identifier and a remote directory path as inputs
  2. Return detailed metadata for each item in the directory including:
    • Item name
    • Item type (file, directory, or other)
    • Size in bytes (for files)
    • Modification timestamp
    • Any other available metadata attributes
  3. Return the data in a structured format (e.g., dictionary or list of dictionaries)
  4. Handle cases where the remote path doesn't exist or is inaccessible

Implementation

@generates

API

def get_directory_metadata(ftp_conn_id: str, remote_path: str) -> dict:
    """
    Retrieve structured metadata for all items in a remote FTP directory.

    Args:
        ftp_conn_id: The Airflow connection ID for the FTP server
        remote_path: The path to the remote directory

    Returns:
        Dictionary mapping item names to their metadata attributes
    """
    pass

Test Cases

  • Given a valid FTP connection and an existing remote directory path "/data", the function returns a dictionary containing metadata for all items in that directory @test
  • The returned metadata for a file includes at minimum: the item name, type indicator, and size @test
  • When the remote directory contains subdirectories, those subdirectories are included in the results with appropriate type indicators @test

Dependencies { .dependencies }

apache-airflow-providers-ftp { .dependency }

Provides FTP operations support for Apache Airflow including connection management and file transfer capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/apache-airflow-providers-ftp@3.13.x
tile.json