Skip to main content

Build PDFs in Python easily using a component-based structure.

Project description


An easy to use, component-based PDF creator for Python built on top of ReportLab

BSD License

FeaturesQuickstartInstallationDocsTO-DOCredits

Features

This tool allows you to easily build PDF documents using a component-based architecture, similar to frameworks like Streamlit.

It uses a simple syntax that let's you iterate through prototypes fast, so you can easily adjust the PDFs to your liking.

Quickstart

An example of how to create a basic document using Scriber:

from scriber import pdf, ui

with pdf.document("quickstart.pdf") as doc:
  ui.text("Quarterly Overview")
  ui.text("A minimal report built with plain text, labeled separators, and tables")

  ui.labeled_separator("Key Metrics")
  ui.table(
      [
          {"Metric": "Revenue", "Q2 FY24": "$1.8M", "Δ vs Q1": "+5%"},
          {"Metric": "Active Users", "Q2 FY24": "12,430", "Δ vs Q1":"+7%"},
          {"Metric": "Churn", "Q2 FY24": "3.2%", "Δ vs Q1": "-0.4%"},
      ],
      columns=["Metric", "Q2 FY24", "Δ vs Q1"],
      zebra=True,
  )

  ui.labeled_separator("Notes")
  ui.text("• Metrics pulled from the analytics warehouse on 2024-07-05.")
  ui.text("• Refresh the report by rerunning this script after the nextdata sync.")

This code will create the following PDF:

Installation

-- Working on uploading Scriber to Python Package Index --

Components

Containers

  • row — Horizontal container with configurable gap and justification.
  • column — Vertical stack with optional gap and growth hints.
  • card — Padded container with optional radius and grow props.

Typography & Numbers

  • text — Body or muted paragraph text with variant overrides.
  • h1 — Large heading styled via theme tokens.
  • h2 — Medium heading variant.
  • h3 — Smaller heading variant.
  • number — Formats numeric values (currency, percent, etc.) using document settings.

UI Elements

  • badge — Pill-style label supporting variants.
  • button — Action button with variant-driven styling.

Layout & Spacing

  • separator — Horizontal rule with thickness, color, and margin controls.
  • labeled_separator — Separator with centered label and configurable gap/ margins.
  • spacer — Vertical whitespace helper using spacing tokens.

Data & Media

  • table — Tabular data renderer with alignment and zebra striping options, supports Pandas and Polars dataframes.
  • figure — Embeds Matplotlib/Plotly/Altair/Plotnine figures with sizing and captions
  • image — Embeds local or remote images with fit, alignment, and caching

Document Structure

  • cover — Full-page cover with title, subtitle, and metadata rows
  • toc — Generated table of contents with depth and dot leader controls

Docs

TO-DO

Credits

ReportLab - Used for rendering the PDFs.

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

scriber_pdf-0.1.0.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scriber_pdf-0.1.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scriber_pdf-0.1.0.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scriber_pdf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9e562e5e4fc7a6e0198767921753409c78255c933acaaa3de4a9949664a7a331
MD5 e652bb06417cd5223783e66c5537c166
BLAKE2b-256 8c67e6f8af2ddc5b66e972bfe8f76f72531829a008a44b745a2d83941bca6bc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriber_pdf-0.1.0.tar.gz:

Publisher: publish.yml on FabianUB/scriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: scriber_pdf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scriber_pdf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dd569a706928fb6a0322e6309ccb6840b41bcff0432355b126d08cadc99510a
MD5 d5742bd87516eba5377efeee0de7cfd8
BLAKE2b-256 27b6363b0b36d3751c5b8b641ef11a2fad267c5fb08f41be6d7054c38cb22fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriber_pdf-0.1.0-py3-none-any.whl:

Publisher: publish.yml on FabianUB/scriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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