Skip to content

yiqisoft/app-functions-sdk-python

 
 

Repository files navigation

Application Functions SDK for Python

The EdgeXFoundry Application Functions Software Development Kit (SDK) for Python. This is a Python para SDK for the app-functions-sdk-go, which is designed to help you create EdgeX application services that can process/transform/export data from EdgeX.

Prerequisites

This Python SDK is supported on Python 3.10 or later.

File Structure

This Python SDK is designed to follow the file structure that can be installed by pip package installer as a Python package app_functions_sdk_py.

The file structure of this Python SDK is as follows:

  • app-service-template: this folder contains a template for creating a new EdgeX application service using this Python SDK.
  • src/app_functions_sdk_py: this folder contains the source code of the Python SDK with top-level package app_functions_sdk_py, which is further divided into the following subpackages:
  • app_functions_sdk_py: this subpackage contains modules for implementation of the Python SDK.
  • tests: this folder contains the unit tests for the Python SDK. Any new unit-tests should be added here with corresponding file structure as to src/app_functions_sdk_py.
  • setup.py: this file is used to package the Python SDK into a Python package. This file is used to dynamically specify the package version.
  • pyproject.toml: this file is used to specify the build system requirements for the Python SDK.
  • Makefile: the Makefile used to build and test the Python SDK.
  • requirements.txt: this file specifies the dependencies required to build and test the Python SDK.

Features Supported

This Python SDK aims to facilitate the development for a python developer to create their own EdgeX Application Service with following features:

  • Basic logging mechanism
  • Load and apply the EdgeX environment variables
  • Consume configuration from YAML configuration file
  • Consume configuration from EdgeX Keeper
  • Process incoming data from EdgeX Message Bus via either MQTT or NATS-Core
  • Process incoming data from a HTTP POST request
  • Basic EdgeX common REST API, such as ping, version, and config

The SDK also provides the following built-in functions to process/transform/export data from EdgeX:

Run Tests

To run the unit-tests against SDK, you can use the following command:

make test-sdk

You can also run the tests against the app-service-template by using the following command:

make test-template

To have lint to analyse the SDK, you can use the following command:

make lint

To run tests, and lint analysis altogether, you can use the following command:

make test

Build Docker images

To build the Docker image for the app-service-template, you can use the following command:

make docker

By a successful build, a docker image $(USER)/app-service-template:latest will be created in your local environment.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Other 0.3%