Python Development

To start using Python to develop applications you'll want to add pip to install python packages. To do this you need to add the 'dev_repo' on the device using the apx-core tool.

$ sudo apx-core add_dev_repo

Once that's done you can install packages with the following command:

python -m pip install --user PACKAGE_NAME

Example use of requests package:

python -m pip install --user requests
>>> import requests
>>> data = requests.get('http://localhost/system-info')
>>> print(data.content)
{"ram":{"total":506084,"used":140904,"free":85472,"available":346848},"cpu":{"currF":1000,"usage":22.0079,"governor":"ondemand","stats":{"300":6218.2,"600":579130.83,"720":7092.62,"800":9264.24,"1000":20422.01}},"rootfs":{"total":444018,"free":150107},"datafs":{"total":2223416,"free":2033060},"uptime":622129,"loadAvg":[0.77,1.01,1.05],"apexVersion":"apex-20.52.1","releaseDate":"20201221234751","sessionCount":14,"kernelVersion":"5.4.20-g738552d0b0","netLink":{"name":"wlan0","ip":"192.168.0.201"},"hostname":"syrus-867698041100127"}
>>> print(data.json()['kernelVersion'])
5.4.20-g738552d0b0