Skip to main content

Python SDK for interacting with the Evolve platform

Project description

Build Status Coverage

Zepben Evolve Python SDK

The Python Evolve SDK contains everything necessary to communicate with a Zepben EWB Server. See the complete Evolve Python SDK Documentation for more details.

Note this project is still a work in progress and unstable, and breaking changes may occur prior to 1.0.0.

Requirements

  • Python 3.7 or later
  • pycryptodome, which requires a C/C++ compiler to be installed. On Linux, python headers (typically python-dev) is also necessary to build pycryptodome.
On Windows systems:

Download and run Build Tools for Visual Studio 2019

When in the installer, select and install:

  • C++ build tools
  • Windows 10 SDK
  • The latest version of MSVC v142 x64/x86 build tools.

After this you should be able to pip install zepben.evolve without issues.

Installation

pip install zepben.evolve

Building

python setup.py bdist_wheel

Developing

This library depends on protobuf and gRPC for messaging. To set up for developing against this library, clone it first:

git clone https://github.com/zepben/evolve-sdk-python.git

Install as an editable install. It's recommended to install in a Python virtualenv

cd evolve-sdk-python
pip install -e .[test]

Run the tests:

python -m pytest

You can generate the coverage report using the following options:

 pytest --cov=zepben.evolve --cov-report=html --cov-branch

If you need to debug a test, you will need to annotate the test with the following to prevent the test from timing out while you step through the code:

# todo remove timeout before commit
@pytest.mark.timeout(100000)

Checklist for model changes

  1. Update setup.py to import the correct version of zepben.protobuf.
  2. Model updating:
    1. Add new classes to the model package.
    2. Descriptions copied from Evolve CIM Profile documentation and added as doc comments to new changes (on class, property etc)
  3. Update translator package:
    1. Update __init__.py:
      • from zepben.protobuf...<new_class_name>_pb2 import <new_class_name>
      • <new_class_name>.mrid = lambda self: self...mrid()
    2. Update network_cim2proto.py:
      • import <new_class_name> as PB<new_class_name>
      • Add def <new_class_name>_to_pb
      • Add "<new_class_name>_to_pb" to __all__
      • Add <new_class_name>.to_pb = <new_class_name>_to_pb
    3. Update network_proto2cim.py
      • import <new_class_name> as PB<new_class_name>
      • Add def <new_class_name>_to_pb
      • Add "<new_class_name>_to_cim" to __all__
      • Add <new_class_name>_to_cim = <new_class_name>_to_cim
  4. Update network_rpc.py
    • Add from zepben.protobuf...<new_class_name>_pb2 import <new_class_name>
    • Add <new_class_name>: ('Create<new_class_name>', Create<new_class_name>),
  5. Add reference resolver(s) to resolvers in common package (if new associations).
  6. Testing:
  7. Update release notes in changelog.md.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

zepben.evolve-0.23.0b21-py3-none-any.whl (244.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page