Skip to main content

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

Uploaded Source

Built Distribution

reportobello-0.2.3-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for reportobello-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1d21261620c84618002ef2f5f3c508fa8521543b9ab0ac288d7b2e8d6f5dcc30
MD5 461d979214b500737338b70f97c429c7
BLAKE2b-256 908832bcd5d1fa13a41b8ff045925791f7b21ef39948ba658efd1be4545ac7f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reportobello-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for reportobello-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3002a2f6a9fcf368f9bbd6fe1b83fee76f73d67d39ea739672fad5890790188f
MD5 58ab639d279822266465e5cd46cf049a
BLAKE2b-256 ef498d9e4e8c84459401b28d96493a9f334e2397baf547da74f4ab62271f0aef

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