Metadata-Version: 2.1
Name: pyazureutils
Version: 0.5.0.10
Summary: a collection of utilities for interacting with Microsoft Azure Web Services
Home-page: http://www.microchip.com
Author: Microchip Technology
Author-email: support@microchip.com
License: Microchip Technology Inc. Proprietary License
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Description-Content-Type: text/markdown
Requires-Dist: pytz
Requires-Dist: cryptography
Requires-Dist: pyedbglib (>=2.14)
Requires-Dist: pykitcommander (>=0.3.*)
Provides-Extra: dev
Requires-Dist: pylint ; extra == 'dev'
Requires-Dist: mock ; extra == 'dev'

# pyazureutils
pyazureutils is a collection of utilities for interacting with Microsoft Azure Web Services.

## Usage
pyazureutils is intended as a library but could also be used stand-alone as a CLI (not yet implemented).  Its primary consumer is iotprovision.

### Library
pyazureutils can be used as a library by instantiating any of the contained classes.

For example to perform provisioning for Azure IoT:
```
# pyazureutils uses the Python logging module
import logging
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.WARNING)

# The target must be running provisioning firmware, pykitcommander is used to accomplish this.
# It locates the bundled firmware for the function requested, programs it onto the MCU on the kit
# and returns a protocol object and port for communicating with the application
from pykitcommander.kitprotocols import get_protocol
protocol, port = get_protocol("iotprovision-azure")

# Instantiate the provisioner
from pyazureutils.custom_provision import AzureCustomProvisioner
provider_provisioner = AzureCustomProvisioner("my_signer_ca_key_file",
                                              "my_signer_ca_cert_file",
                                              "generated_device_csr_file",
                                              "generated_device_cert_file")

# Do the actual provisioning
device_id = provider_provisioner.provision(protocol, port)
```
The above example will generate a device certificate and save it along with the CA signer certificate in WINC flash. Generated certificates and Device ID are saved to files as well.

## Logging
This package uses the Python logging module for publishing log messages to library users.

A basic configuration can be used (see example), but for best results a more thorough configuration is recommended in order to control the verbosity of output from dependencies in the stack which also use logging.

## Dependencies
This package uses pyedbglib through other libraries for USB communications.  For more information see: https://pypi.org/project/pyedbglib/.

## Versioning
pyazureutils version can be determined by:
```
from pyazureutils.version import VERSION as pyazureutils_version
print("pyazureutils version {}".format(pyazureutils_version))
```

