Skip to main content

This project/library contains common elements related to FTP connections...

Project description

core-ftp


This project/library provides a comprehensive set of common components and interfaces designed to facilitate and streamline FTP connections, ensuring efficient communication and data transfer...

Execution Environment

Install libraries

pip install --upgrade pip 
pip install virtualenv

Create the Python Virtual Environment.

virtualenv --python={{python-version}} .venv
virtualenv --python=python3.11 .venv

Activate the Virtual Environment.

source .venv/bin/activate

Install required libraries.

pip install .

Check tests and coverage...

python manager.py run-tests
python manager.py run-tests --test-type functional --pattern "*.py"
python manager.py run-coverage

How to Use

Installation...

pip install core-ftp

Examples...

from core_ftp.clients.sftp import SftpClient

with SftpClient("test.rebex.net", 22, "demo", "password") as client:
    for x in client.list_files("/"):
        print(x)
from core_ftp.clients.sftp import SftpClient

with SftpClient(
        host="localhost", port=23,
        user="foo", private_key_path="key_path") as client:

    for x in client.list_files("/"):
        print(x)

Docker

You can use docker to create an SFTP server to test the client using the functional tests via command python manager.py run-tests --test-type functional --pattern "*.py" and the following docker image: <atmoz/sftp> (https://hub.docker.com/r/atmoz/sftp/).

Authentication via user & password...

docker run \
  -v ./tests/resources/upload:/home/foo/upload:rw \
  -p 22:22 -d atmoz/sftp foo:pass:::upload

Authentication via SSH key...

docker run \
  -v ./tests/resources/ssh_keys/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro \
  -v ./tests/resources/upload:/home/foo/upload:rw \
  -p 23:22 -d atmoz/sftp foo::1001

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

core_ftp-1.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

core_ftp-1.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file core_ftp-1.1.1.tar.gz.

File metadata

  • Download URL: core_ftp-1.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_ftp-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f6ccbdcda8f1a71ba6b3be5de5ee70e1d6a4968231f5bf1394059f581e5eade7
MD5 89980373bf8b393f4940b85a6a2f03df
BLAKE2b-256 b9bee6fa984a16393b70b9a283b349afcacf741a348e9610f928c6c2e939123c

See more details on using hashes here.

File details

Details for the file core_ftp-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: core_ftp-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for core_ftp-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd6870564dac7b9044f9e3e2da772546e2fe94fbd6ef10151f93c8ef4cb95600
MD5 a32356bc28cf65a2b1dcd39b036b31da
BLAKE2b-256 ba9b0f62c97c7caf280351492821779c5baedc0fa2ba10e002841fad6590842a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page