Skip to main content

Python API library for Reportobello

Project description

Reportobello

Python API library for Reportobello.

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.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

reportobello-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file reportobello-0.1.0.tar.gz.

File metadata

  • Download URL: reportobello-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for reportobello-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6efcd3a3843367985bade790bf32624406df2c4f33542ce4fb4d268225ffdfb
MD5 1af16c91f2b5697fc0f58e5961a038fc
BLAKE2b-256 aa43895d81d0e2c2dc70e74141c41280923af4d1d8188df46c916ac44f3a2655

See more details on using hashes here.

File details

Details for the file reportobello-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reportobello-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b4db448d24f52aead0958f44d95de4d41d5133faee62749764ac87ca82107ea
MD5 9636384e9e6a3954e4997f44d30dd254
BLAKE2b-256 16c34fe9cade2ade841a331bcc638fdade1b6b91d8b5ab6326b0b9a25327bc8c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page