Generate a PDF using Streamlit

You can generate a PDF report in Peliqan in different ways. In this example, we are making data visualisations first, and then we save these to a PDF report.

We are using the built-in Streamlit module (st) in Peliqan to render our data visualisations (tables, charts etc.). Next we use the Peliqan module (pq) to convert the Streamlit output on screen to a PDF document.

Example low-code Python script in Peliqan:

import pdfkit

dbconn = pq.dbconnect('dw_123')
data = dbconn.fetch('dw_123', 'crm', 'INVOICES')

# Use any Streamlit data visualisation here
st.bar_chart(data, x = "country", y = "revenue")

pq.download_pdf_button(report, file_name = "report.pdf", label = "Download PDF")