CData Python Connector for SFTP

Build 21.0.7930

Establishing a Connection

The objects available within our connector are accessible from the "cdata.sftp" module. In order to use the module's objects directly, the module must first be imported as below:

import cdata.sftp as mod

From there, the connect() method can be called from the connector object to establish a connection using an appropriate connection string, such as the below:

mod.connect("RemoteHost=MySFTPServer;")

The CData Python Connector for SFTP allows connecting to SFTP servers.

Connecting to an SFTP Server

SFTP can be used to transfer files to and from SFTP servers using the SFTP Protocol. To connect, specify the RemoteHost. SFTP uses the User and Password and public key authentication (SSHClientCert). Choose an SSHAuthMode and specify connection values based on your selection.

Connecting to Data

Set the following connection properties to control the relational view of the file system:

  • RemotePath: Set this to the current working directory.
  • TableDepth: Set this to control the depth of subfolders to report as views.
  • FileRetrievalDepth: Set this to retrieve files recursively and list them in the Root table.
Stored Procedures are available to download files, upload files, and send protocol commands. See Data Model for more on using SQL to interact with the server.

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930