Python SDK for interacting with the Evolve platform
Project description
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
- Update
setup.py
to import the correct version ofzepben.protobuf
. - Model updating:
- Add new classes to the cim model package.
- Descriptions copied from Evolve CIM Profile documentation and added as doc comments to new changes (on class, property etc)
- Add comparisons to service packages.
- Update translator package:
- Update
__init__.py
:from zepben.protobuf...<new_class_name>_pb2 import <new_class_name>
<new_class_name>.mrid = lambda self: self...mrid()
- 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
- 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
- Update
- 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>),
- Add
- Add reference resolver(s) to resolvers in common package (if new associations).
- Testing:
- Test for model classes.
- Added new classes to service translator test.
- Add the required creators to:
- Add test for each new comparison to test/services/... package.
- Add test for each new class to test/cim/... package.
- Verify that all the test are passing.
- 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
Built Distribution
Hashes for zepben.evolve-0.23.0b25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 463f13504158c565c02ab62ca8e4e68eb56bca587390d4f07fc96e19b4f147b9 |
|
MD5 | 8dd8b6be4473d3a2ae43df49d2fbf083 |
|
BLAKE2b-256 | 0c9c2a9158a89d0a20e270791e7b35f79b3c48111dfd0305b71342ee057a8f5a |