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 an async test, you will need to annotate the test with the following to prevent the test from timing out while you step through the code:
@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 model package.
- Descriptions copied from Evolve CIM Profile documentation and added as doc comments to new changes (on class, property etc)
- 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:
- Add the required creators to:
- Update
constructor_validation.py
- Add test for each new class to test/cim/... package.
- Verify that al 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.0b16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1af9facf2cd6540206461ded3894220f2eafecf4f3dcd370da3b2160b1d91df9 |
|
MD5 | 1cd96701c8633de4a1658baa856e4c59 |
|
BLAKE2b-256 | 649ac7ff162ae4fb17229846121fff2fb46301d2ebdafad7b093f23d2cd550f0 |