Adding a Report

You add a report to the Report List by following the steps below…

Create a new Folder in the Report directory

In your reports directory, you can create a folder for every report. Note that while it's not required, we suggest avoiding spaces in your folder names.

For instance, if you wanted to create a “Daily Temperature” report, you would make a folder called daily_temperature.


Create an Empty Script File

Now, create a Python script file.

This can either be called report.py, or it can have the same name as the folder itself, plus the 'py' extension (even in Linux, please include the extension).

To continue the example above, you could create either /daily_temperature/daily_temperature.py or /daily_temperature/report.py.

NOTE: In some cases, you might want to copy an existing report instead of creating a new Python script.


Copy/Create an Info.txt file for the report

The Info.txt file gives the system some details about the report - it's name, the time range it should cover etc.

Info files have four lines….

LineExampleMeaning
NameDaily TemperatureThe name for the report shown in the web interface
Hours24The number of hours the report covers by default
Start Date2020-01-01 06:00:00A starting date & time to base the 24 hour rotation from
TimezoneAustralia/SydneyA timezone for the report
FolderBlankA folders that the report should appear in
ExtensionPDFThe file extension of the output report

Create the Python Script

The included libraries assume that you will be using MatPlotLib to create your reports, but you are free to use whatever Python reporting toolkit you prefer (or can use Python to launch other processes to generate your report information as well).

For further details and examples, see Writing a Report in Python and MatPlotLib.