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",)
CELERYBEAT_SCHEDULE.update(
{
"reports.pdf-scheduler": {
"task": "reports.pdf-scheduler",
"schedule": crontab(minute="*"),
}
}
)
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.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d2f8cf21f8657939bd0e72421ebcb529d4148b1d97231d3027d78f9c0a48dab |
|
MD5 | 83ac90ea0f5f47d353789c0b88a292cb |
|
BLAKE2b-256 | adc3116d37ad8870fa34c69e1700bbe60c246abd4f6232654f4ca71151092c39 |
Hashes for superset_pdf_report-0.6.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba3297418bb9ccaf5f410f022dd480ac3d27c1284446f0afc87c366bf1a30aaa |
|
MD5 | 38ad3230e2e30c27d6954be9a2ba0ca3 |
|
BLAKE2b-256 | 400009767b647fa73cd9af588c5c71035f9d985dbd80e7299899ccb24880536b |