Python SDK for the Reportobello API
Project description
Reportobello
Python SDK for the Reportobello API.
This package also includes the Reportobello CLI, rpbl
.
To learn more about the CLI, read the docs here.
Installing
$ pip install reportobello
Basic Usage
Below is a full exmaple of how to create reports in Reportobello.
This example is ready to go, and can be copy-pasted into your project.
from dataclasses import dataclass
import asyncio
from reportobello import ReportobelloApi, Template
@dataclass
class QuarterlyReport(Template):
name = "quarterly_report"
# See Typst docs for syntax: https://typst.app/docs
content = """
#let data = json("data.json")
= Q#data.quarter Earnings Report
Generated: #datetime.today().display()
Earnings: #data.earnings
"""
# Alternatively, store in a file
# file = "report.typ"
quarter: int
earnings: float
api = ReportobelloApi()
async def main():
template = QuarterlyReport(quarter=1, earnings=123_456)
# You only need to run this if the template above changes
await api.create_or_update_template(template)
pdf = await api.build_template(template)
print(f"Downloading {pdf.url}")
await pdf.save_to("output.pdf")
asyncio.run(main())
Read the docs for more info.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reportobello-0.2.2.tar.gz
(9.6 kB
view details)
Built Distribution
File details
Details for the file reportobello-0.2.2.tar.gz
.
File metadata
- Download URL: reportobello-0.2.2.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c0e5dfba425b64098e7387ef6f3d5f55e7be6c63a81e4fa26cd0f227d9d2d58 |
|
MD5 | 6dd42cac926f1a3ce33cacad4a2db34d |
|
BLAKE2b-256 | 0256429fe38c5ec47951b47e79097bae6cff09d71c17c627a9f7ae6edf442820 |
File details
Details for the file reportobello-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: reportobello-0.2.2-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f560bafb788ea91ef751e7b863730a80ae8bb90b0444a30236851349fed0a2c |
|
MD5 | e84ac2c53e2b931c047b4c20a19b8f79 |
|
BLAKE2b-256 | afbc019281fd6780fd97ae2d3b3b8328d5ba62dd6a360fade559a6af7705611c |