Skip to main content

IoT FTPS Client Library for Python

Project description

iot-ftps-client

python version pre-commit Keep a Changelog CI_CD GitHub_Actions package PyPI

This package is a wrapper around the ftplib protocol to provide a synchronous client for interacting with FTPS servers from IoT edge devices.

Source code | Package PyPI

Table of Contents

Versioning

This repository adheres to Semantic Versioning. It will be maintained through the CHANGELOG.md and in GitHub Releases. It's important to note that you must maintain the version with your releases in iot/ftps/client/_version.py, otherwise a new package version will fail to get published.

Getting Started

This section provides basic examples with the iot-ftps-client.

Prerequisites

  • Python 3.7 or later is required to use this package.

Basic Examples

  1. Install via pip:

    pip install iot-ftps-client
    
  2. Import and say hello:

    from iot.ftps.client import __version__
    
    
    print(f"hello world from iot-ftps-client version: {__version__}")
    
  3. Basic usage:

    import tempfile
    
    from iot.ftps.client import IoTFTPSClient
    
    # instantiate client
    ftps_client = IoTFTPSClient(
        ftps_host="myServerIP",
        ftps_port=990,
        ftps_user="myServerUsername",
        ftps_pass="myServerPass***",
        ssl_implicit=True,
    )
    
    # print info w/ repr
    print(f"{ftps_client.__repr__()}")
    
    # download blob to tempfile
    temp_file = tempfile.NamedTemporaryFile()
    download_result = ftps_client.download_file(
        source="path/to/blob.txt",
        dest=temp_file.name,
    )
    if not download_result:
        print("unable to download file")
        temp_file.close()
        raise
    
    # upload tempfile to blob
    upload_result = ftps_client.upload_file(
        source=temp_file.name,
        dest="path/to/new/blob.txt",
    )
    if not upload_result:
        print("unable to upload file")
        temp_file.close()
        raise
    
    # clean-up local memory
    temp_file.close()
    

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

iot-ftps-client-1.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

iot_ftps_client-1.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file iot-ftps-client-1.0.1.tar.gz.

File metadata

  • Download URL: iot-ftps-client-1.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for iot-ftps-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 84829f3864ab4f3b0f463e40495b5c06b596641390bebc79672c04a097ee5189
MD5 0cb262ea87b32cab50a0e2e0b697458f
BLAKE2b-256 18be2952fc362503a3475002fc76816f20eb9a88e52521e061d0dec91c2e1848

See more details on using hashes here.

File details

Details for the file iot_ftps_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for iot_ftps_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f22fc7ea648b9759b641cd3b862cf6165aecfcacbf6cc44d877076b87ed46605
MD5 2f931c9a748795fb9d8e3e767f8559a9
BLAKE2b-256 cf8474ae373dad2d87f5e48804b534dc78ff248df5f4d89fca6d6812fa104f5e

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