This repo contains sample custom reports generated in Python for the Sensolus application. Those reported are generated offline and then uploaded to system.
Every report can be run from the command line or as a AWS Lamba function.
This report creates an XLS file which contains the journeys for all trackers of the previous day. For every journey segment the start location, start time, stop location, stop time, distance & duration is given.
The most practical way is to setup a virtual environment for python
virtualenv -p python3 ENV
source ./ENV/bin/activate
Now install all dependencies:
pip install -r requirements.txt
Every report
See https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-venv for instructions on package a Python script with its dependencies.
The instructions are repeated here:
- Decativate the virtual environment
deactivate
- Add the dependent libraries at the root
cd ENV/lib/python3.8/site-packages
zip -r ../../../../my-deployment-package.zip .
cd ../../../..
Note that your python version might be different. Update if needed.
- Add our own scripts to the mix
zip -g my-deployment-package.zip reports/*
- Upload the zip throught the lambda web console