Skip to main content

iot-storage-client

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

This package is a wrapper around the azure-storage-blob SDK to provide an asynchronous and synchronous client for interacting with Azure storage accounts in the cloud and on the edge.

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

Getting Started

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

Prerequisites

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

  • You must have an Azure subscription and Azure storage account to use this package.

Basic Examples

  1. Install via pip:

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

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

    import tempfile
    
    from iot.storage.client import CredentialType, LocationType, IoTStorageClient
    
    # instantiate client
    storage_client = IoTStorageClient(
        credential_type=CredentialType.ACCOUNT_KEY,
        location_type=LocationType.CLOUD_BASED,
        account_name="myAzBlobStorageAcctName",
        credential="myBlobPrimaryKey***"
    )
    
    # print info w/ repr
    print(f"{storage_client.__repr__()}")
    
    # download blob to tempfile
    temp_file = tempfile.NamedTemporaryFile()
    download_result = storage_client.download_file(
        container_name="myAzBlobContainerName",
        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 = storage_client.upload_file(
        container_name="myAzBlobContainerName",
        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()
    
  4. Basic async usage:

    import tempfile
    
    from iot.storage.client import CredentialType, LocationType, IoTStorageClientAsync
    
    # instantiate client
    storage_client = IoTStorageClientAsync(
        credential_type=CredentialType.ACCOUNT_KEY,
        location_type=LocationType.CLOUD_BASED,
        account_name="myAzBlobStorageAcctName",
        credential="myBlobPrimaryKey***"
    )
    
    # print info w/ repr
    print(f"{storage_client.__repr__()}")
    
    # download blob to tempfile
    temp_file = tempfile.NamedTemporaryFile()
    download_result = await storage_client.download_file(
        container_name="myAzBlobContainerName",
        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 = await storage_client.upload_file(
        container_name="myAzBlobContainerName",
        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()
    

Metadata

Release files for iot-storage-client 1.2.2

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-storage-client 1.2.2
File Size Uploaded Provenance
iot-storage-client-1.2.2.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iot-storage-client 1.2.2
File Interpreter ABI Platform
iot_storage_client-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / iot-storage-client-1.2.2.tar.gz

Download URL iot-storage-client-1.2.2.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
205431ed1ad334ef2e5c0b8c88dd2225a007728cc751f38dc8d3d280cfe639bd
BLAKE2b-256 checksum
How to use checksums
de3dd0434dd99a99ea8e599233ca204fa57389b4a0727c322a2fc9bbfa770426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.16

Release files / iot_storage_client-1.2.2-py3-none-any.whl

Download URL iot_storage_client-1.2.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c869bdbd8ca7823ae104215d12b01bfe80c4adc0ea827487a88187748f931d3
BLAKE2b-256 checksum
How to use checksums
2995072b21a35de7fdde7d092b479ad86d94c7dcf2edb3ad492819b3da0ec86e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.16

Security for iot-storage-client 1.2.2

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