Skip to content

Repository files navigation

oocana-python

This project contains two Python packages: oocana and executor. oocana is a module used by Python blocks, while executor is a runtime for executing all Python Blocks. Both have been published to PyPI.

oocanapython-executor

How to Use

Installation

pip install oocana
pip install oocana-python-executor
  • oocana
fromoocanaimportContextdefmain(props, context: Context):
return {
"message": "Hello from Python blk_b"
}
  • executor

need to install oocana-python-executor package.

Development

pdm install

Test

oocana unit tests require an MQTT broker connection. You can start an MQTT broker externally. We recommend using mosquitto.

# Install mosquitto on macOS, for other systems please refer to the documentation
brew install mosquitto
# Start mosquitto, -d for background running, -p for port number
mosquitto -p 47688

Then you can run the tests.

# need run mqtt broker
pdm run test

About

oocana

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages