Skip to content

SFTP ​

Reads files from remote_path on an SFTP server. Use it when a partner still drops files that way.

Before you begin ​

  • Host, username, and a readable remote directory.
  • A password or a private key.
bash
export SFTP_PASSWORD="change-me"

Configure ​

python
from skippr import Config, DataSourceSftp, EnvRef, Pipeline

cfg = Config.discover()
src = cfg.data_source(
    "partner",
    DataSourceSftp(
        host="sftp.partner.example",
        username="skippr",
        remote_path="/export/daily",
        port=22,
        password=EnvRef("SFTP_PASSWORD"),
        format="csv",
    ),
)
cfg.pipeline("partner", Pipeline(data_source=src))
cfg.save()
bash
skipprd connect data-source sftp \
  --pipeline partner \
  --name partner \
  --host sftp.partner.example \
  --username skippr \
  --remote-path /export/daily \
  --port 22 \
  --password '${SFTP_PASSWORD}' \
  --format csv
yaml
data_sources:
  partner:
    Sftp:
      host: sftp.partner.example
      username: skippr
      remote_path: /export/daily
      port: 22
      password: ${SFTP_PASSWORD}
      format: csv

Options ​

KeyTypeRequired/DefaultDescription
hoststringRequiredSFTP host
usernamestringRequiredUser
remote_pathpathRequiredRemote directory or file
portintegerNot setPort (default 22)
passwordsecretNot setPassword as ${ENV}
private_key_pathpathNot setPrivate key file
formatstringInferredjson, csv, or parquet
batch_size_bytesintegerNot setMax bytes per batch
batch_size_secondsintegerNot setMax seconds per batch

What gets synced ​

Each file becomes records. Progress is per remote file. A file that changes after a commit is read again.

Troubleshooting ​

SymptomFix
Connection refusedCheck host, port, and firewall
Auth failedConfirm password or key
No filesCheck remote_path and the user's directory listing rights

Next steps ​