For generating a pdf-report with apache-superset charts
Project description
superset-pdf-report
superset-pdf-report is a Python tool for downloading charts from the Apache Superset API or URLs to generate a PDF report via LaTeX and send it via e-mail.
There are two possiblilities for using this tool:
- run it by Celery via supersetconfig.py
- run it via class PDF_report
Installation
Use the package manager pip to install superset-pdf-report.
pip install superset-pdf-report
Configuration of superset-pdf-report
Open config.py in supersetpdfreport and enter the needed information or use the suggested environment variables.
Create your job
Create a <your_job>.json
in supersetpdfreport/jobs
Please refer to the example_job.json
Configuration and start via Celery
Insert in superset_config.py
Celery config:
CELERY_IMPORTS = 'supersetpdfreport.task'
Add task in CELERYBEAT_SCHEDULE
'pdf-report':{
'task':'pdf-report',
'schedule': crontab(<YOUR TIMING>),
'kwargs':{
'job_name': '<your_job>.json'
},
}
You have to restart your Apache Superset application for this changes.
Start via PDF_report()
Create a start.py
from supersetpdfreport.pdf_report import PDF_report
job_name = "<your job>.json"
pdf_report_task = PDF_report()
pdf_report_task.execute(job_name)
Start the Python script
python3 start.py
Usage
- Download the charts you need for the report
- Download the images you need for the report
- Create your LaTeX file in /latex and use the images in latex/images
- Activate the "generate_pdf" in job
- Send it via e-mail or send to nextcloud
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for superset-pdf-report-0.6.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 783ad5aa780bbe4c404db3ae507a2e6027b5cb9bf9ea92ca46cac43553ebdabd |
|
MD5 | 24e4fe902598610cdda8c053d127549a |
|
BLAKE2b-256 | 9d261b4ea2fca42fcba95f1ba480522d84ffdda59051d66c9f36acc106b83586 |
Hashes for superset_pdf_report-0.6.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 529f7cea14b39acf5a3b05677425e4a822253311faf2111799d8730118ded399 |
|
MD5 | 8a379797dc0733b276b5f1e80a0c808a |
|
BLAKE2b-256 | 4a7064015c71343a6559b89824cd480bd6ea4e23b2641e50ee60119e4159f6a6 |