iot-samba-client


Nameiot-samba-client JSON
Version 1.0.4 PyPI version JSON
download
home_page
SummaryIoT Samba Client Library for Python
upload_time2022-08-17 19:00:00
maintainer
docs_urlNone
authorDylan Gonzales
requires_python>=3.7
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # iot-samba-client

[![python version](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow)](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow) [![pre-commit](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040)](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040) [![Keep a Changelog](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735)](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735) [![CI_CD GitHub_Actions](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black)](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black) [![package PyPI](https://img.shields.io/badge/PyPI-blue?logo=PyPI&logoColor=yellow)](https://img.shields.io/badge/PyPI-blue?logo=pypi&logoColor=yellow) [![smbprotocol version](https://img.shields.io/badge/smbprotocol_v1.9.0-blue?logo=sabanci&logoColor=004B93)](https://img.shields.io/badge/smbprotocol_v1.9.0-blue?logo=sabanci&logoColor=004B93)

This package is a wrapper around the [smbprotocol](https://pypi.org/project/smbprotocol/) SDK to provide a synchronous client for interacting with file shares from IoT edge devices.

[Official Documentation](https://py-iot-utils.azurewebsites.net/packages/iotSambaClient) | [Source code](https://github.com/dgonzo27/py-iot-utils/tree/master/iot-samba-client) | [Package PyPI](https://pypi.org/project/iot-samba-client/)

## Table of Contents

- [Versioning](#versioning)
- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Basic Examples](#basic-examples)

## Versioning

This repository adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 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](https://pypi.org/project/pip/):

   ```sh
   pip install iot-samba-client
   ```

2. Import and say hello:

   ```python
   from iot.samba.client import __version__


   print(f"hello world from iot-samba-client version: {__version__}")
   ```

3. Basic usage:

   ```python
   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()
   ```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "iot-samba-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Dylan Gonzales",
    "author_email": "py.iot.utils@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/b7/8f4182fb1f408123de9ca772668511f6aa5ae6dc5a838fc8e375a795e138/iot-samba-client-1.0.4.tar.gz",
    "platform": null,
    "description": "# iot-samba-client\n\n[![python version](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow)](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow) [![pre-commit](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040)](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040) [![Keep a Changelog](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735)](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735) [![CI_CD GitHub_Actions](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black)](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black) [![package PyPI](https://img.shields.io/badge/PyPI-blue?logo=PyPI&logoColor=yellow)](https://img.shields.io/badge/PyPI-blue?logo=pypi&logoColor=yellow) [![smbprotocol version](https://img.shields.io/badge/smbprotocol_v1.9.0-blue?logo=sabanci&logoColor=004B93)](https://img.shields.io/badge/smbprotocol_v1.9.0-blue?logo=sabanci&logoColor=004B93)\n\nThis package is a wrapper around the [smbprotocol](https://pypi.org/project/smbprotocol/) SDK to provide a synchronous client for interacting with file shares from IoT edge devices.\n\n[Official Documentation](https://py-iot-utils.azurewebsites.net/packages/iotSambaClient) | [Source code](https://github.com/dgonzo27/py-iot-utils/tree/master/iot-samba-client) | [Package PyPI](https://pypi.org/project/iot-samba-client/)\n\n## Table of Contents\n\n- [Versioning](#versioning)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Basic Examples](#basic-examples)\n\n## Versioning\n\nThis repository adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 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.\n\n## Getting Started\n\nThis section provides basic examples with the `iot-samba-client`.\n\n### Prerequisites\n\n- Python 3.7 or later is required to use this package.\n\n- You must have a Samba Windows File Share server to use this package.\n\n### Basic Examples\n\n1. Install via [pip](https://pypi.org/project/pip/):\n\n   ```sh\n   pip install iot-samba-client\n   ```\n\n2. Import and say hello:\n\n   ```python\n   from iot.samba.client import __version__\n\n\n   print(f\"hello world from iot-samba-client version: {__version__}\")\n   ```\n\n3. Basic usage:\n\n   ```python\n   import tempfile\n\n   from iot.samba.client import IoTSambaClient\n\n   # instantiate client\n   samba_client = IoTSambaClient(\n       smb_server=\"windows-samba-s\",\n       smb_host=\"1.2.3.456\",\n       smb_port=445,\n       smb_user=\"mySambaUserName\",\n       smb_pass=\"mySambaPass***\"\n   )\n\n   # print info w/ repr\n   print(f\"{samba_client.__repr__()}\")\n\n   # download blob to tempfile\n   temp_file = tempfile.NamedTemporaryFile()\n   download_result = samba_client.download_file(\n       share=\"MY_SAMBA_SHARE\",\n       path=\"path\\\\to\\\\blob\\\\parent\\\\dir\",\n       file=\"blob.txt\",\n       dest=temp_file.name,\n   )\n   if not download_result:\n       print(\"unable to download file\")\n       temp_file.close()\n       samba_client.disconnect()\n       raise\n\n   # upload tempfile to blob\n   upload_result = samba_client.upload_file(\n       share=\"MY_SAMBA_SHARE\",\n       path=\"path\\\\to\\\\new\\\\parent\\\\dir\",\n       file=\"newBlob.txt\",\n       source=temp_file.name,\n   )\n   if not upload_result:\n       print(\"unable to upload file\")\n       temp_file.close()\n       samba_client.disconnect()\n       raise\n\n   # clean-up local memory and disconnect from smb session\n   temp_file.close()\n   samba_client.disconnect()\n   ```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "IoT Samba Client Library for Python",
    "version": "1.0.4",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "afe4313c4db786fd66b42505721fe13f",
                "sha256": "b7d4e96f68b09a9be17bf0d7ef3148b3ddf5f07257cde099e1b9ba7c24c7d723"
            },
            "downloads": -1,
            "filename": "iot_samba_client-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afe4313c4db786fd66b42505721fe13f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4475,
            "upload_time": "2022-08-17T18:59:58",
            "upload_time_iso_8601": "2022-08-17T18:59:58.548070Z",
            "url": "https://files.pythonhosted.org/packages/f2/4e/ee5d757fc2298d03d2526a43fa07bf83cd42863b31d053ffe946ee4bad12/iot_samba_client-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "197ecc69458425f588a32ac28752a6dd",
                "sha256": "aa509e65d94948ad7c7805efa4b48ddfc379e4053f8afd0def54fd7cc2d57f03"
            },
            "downloads": -1,
            "filename": "iot-samba-client-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "197ecc69458425f588a32ac28752a6dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5058,
            "upload_time": "2022-08-17T19:00:00",
            "upload_time_iso_8601": "2022-08-17T19:00:00.179657Z",
            "url": "https://files.pythonhosted.org/packages/12/b7/8f4182fb1f408123de9ca772668511f6aa5ae6dc5a838fc8e375a795e138/iot-samba-client-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-17 19:00:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "iot-samba-client"
}
        
Elapsed time: 0.54531s