Skip to main content

iot-samba-client

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

This package is a wrapper around the smbprotocol SDK to provide a synchronous client for interacting with file shares from IoT edge devices.

Official Documentation | 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/samba/client/_version.py, otherwise a new package version will fail to get published.

Getting Started

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

Prerequisites

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

  • You must have a Samba Windows File Share server to use this package.

Basic Examples

  1. Install via pip:

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

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

    import tempfile
    
    from iot.samba.client import IoTSambaClient
    
    # instantiate client
    samba_client = IoTSambaClient(
        smb_server="windows-samba-s",
        smb_host="1.2.3.456",
        smb_port=445,
        smb_user="mySambaUserName",
        smb_pass="mySambaPass***"
    )
    
    # print info w/ repr
    print(f"{samba_client.__repr__()}")
    
    # download blob to tempfile
    temp_file = tempfile.NamedTemporaryFile()
    download_result = samba_client.download_file(
        share="MY_SAMBA_SHARE",
        path="path\\to\\blob\\parent\\dir",
        file="blob.txt",
        dest=temp_file.name,
    )
    if not download_result:
        print("unable to download file")
        temp_file.close()
        samba_client.disconnect()
        raise
    
    # upload tempfile to blob
    upload_result = samba_client.upload_file(
        share="MY_SAMBA_SHARE",
        path="path\\to\\new\\parent\\dir",
        file="newBlob.txt",
        source=temp_file.name,
    )
    if not upload_result:
        print("unable to upload file")
        temp_file.close()
        samba_client.disconnect()
        raise
    
    # clean-up local memory and disconnect from smb session
    temp_file.close()
    samba_client.disconnect()
    

Metadata

Release files for iot-samba-client 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iot-samba-client 1.0.5
File Size Uploaded Provenance
iot-samba-client-1.0.5.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iot-samba-client 1.0.5
File Interpreter ABI Platform
iot_samba_client-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / iot-samba-client-1.0.5.tar.gz

Download URL iot-samba-client-1.0.5.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84f48fa47dd2dadf718c7b9e1d0f0d8fa155125b1c0ad2433e1da459ef7709da
BLAKE2b-256 checksum
How to use checksums
afdba8189017a7d6a72fb685a06a84b26ec735903e96bd5d866722728d68b249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / iot_samba_client-1.0.5-py3-none-any.whl

Download URL iot_samba_client-1.0.5-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8662081e0e360c6ddeccf470039580f0c0dc15bbf8f6ef93e30dba458be58d88
BLAKE2b-256 checksum
How to use checksums
f082b36e56101b1bbd87597c7eaae7cfc3268b73ce064fedc714816933430e3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for iot-samba-client 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page