---
title: "Custom Action with Connectors source directly"
description: "This example will show you how to get a file directly from a Connectors Source, treat it and put the treated data into a Lakehouse Manager Table"
url: https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/developers-python-sdk-quick-start-source
lang: pt
lastUpdated: 2026-09-14
---
> For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pt/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pt/llms-full.txt.

# Custom Action with Connectors source directly

## Objective

This example will show you how to get a file directly from a [Connectors Source](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/landing-page-connectors-sources.md), treat it and put the treated data into a [Lakehouse Manager Table](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/lakehouse-manager-tables.md).

The code is written in the [Custom Action](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/dpe-actions-custom.md) context and it uses the _chicago\_files_ source from the [Getting Started Tutorial](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/landing-page-getting-started.md). If you did that tutorial, you can just copy and paste the code below to test it, otherwise you need to adapt it to your tables and data sources.

:::tip
This works with any `Source` protocol such as [FTP](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/connectors-sources-ftp.md), [Dropbox](https://docs.ovhcloud.com/pt/guides/public-cloud/data-platform/connectors-sources-dropbox.md), etc.
:::

```python
import sys
from forepaas.dwh.connect import connect
from forepaas.dwh import bulk_insert
import logging

logger = logging.getLogger(__name__)

def customfunc(event):
    try:
        # here we are connecting to a source named 'chicago_files'
        source_address = "dwh/chicago_files_artur/"

        # specify unsupported filename from list of files in source
        filename_w_extension = "stations_rides.csv"

        # connect to to file to get the address 
        source_file_connector = connect(source_address + filename_w_extension) 

        # connect to file directly
        file_address = source_file_connector.get()
        file_connector = connect(file_address) 

        # Extract and treat the file so it is usable
        df = file_connector.extract(return_type='dataframe') 

        # Treat the data
        # - - - - 

        # connect to the Lakehouse Manager
        dm_connector = connect("dwh/default_dataset/")

        # insert into an existing destination table
        stats = bulk_insert(dm_connector, "chicago_calendar_full", df) 

        logger.info(stats)

        # disconnect from datastore and remote source
        del source_connector
        del dm_connector

    except Exception as err:
            raise Exception(f"err:{err} L:{sys.exc_info()[2].tb_lineno}")
```

## Go further

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://www.ovhcloud.com/pt/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.

Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated [Discord channel](https://discord.gg/ovhcloud).

If you need support with your OVHcloud services, create a request in our [Help Centre](https://help.ovhcloud.com/csm?id=csm_get_help).

Join our [community of users](https://community.ovhcloud.com/).
