Getting Started with the Agora Edge App Python SDK
The Python SDK provides modules for developing an Agora Edge App using Python 3.8 or higher. All examples assume this has been installed.
You should also update 'pip':
> pip install -U pip
Create an Edge App
The Agora Edge App Python SDK provides the following modules combined within one Python package called agoraiot:
- agora_logging
- agora_busclient
- agora_config
- agora_utils
To install the package use:
> pip install agoraiot
"Hello World!"
Create a helloWorld.py file:
from agoraiot import logger
logger.info("Hello World!")
Execute using Python:
> python helloWorld.py
Creating an Edge Application Container Image
Create the following files:
helloworld.py [from above]
Dockerfile
Dockerfile:
FROM alpine:3.17
USER root
ENV PATH="${PATH}:/sbin"
RUN apk add bash gcompat libc6-compat icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib python3 py3-pip
RUN pip install agoraiot
ADD ./src src
CMD python3 src/helloWorld.py
Run the following command:
> docker build .