- Data are coming from GoodData's universal semantic layer.
- Desired parts are loaded into frames using pandas factory.
- All put together in HTML format and generated into PDF.
Disclaimer: libraries used to achieve this functionality are picked based on ease of use, if you prefer any other library feel free to consult with last chapter.
- Prepare python virtual environment (or install system-wide = leave out this step)
python -m venv venv
source venv/bin/activate
- Install dependent libraries
pip install gooddata-pandas # access semantic layer
pip install plotly kaleido # exporting visuals to PNG
pip install jinja2 # templating system for HTML
pip install weasyprint # generate PDF from HTML
alternatively install from requirements file:
pip install -r requirements.txt
- Generate the PDF report
python report.py
- Multiple visualization libraries options:
- HTML to PDF generation library (overview):
- pyPDF
- ReportLab
- WeasyPrint (tool of choice)
- https://stackoverflow.com/questions/70384455/how-to-arrange-objects-in-rows-and-columns-and-export-in-svg