Python components: make the design your own¶
Start with a complete invoice, report or community guide. Edit Python functions, data and styles, then generate a PDF and HTML from the same component tree. The 2.6.0a8 preview includes the page-furniture and running-header fixes from stable 2.5.34, with the preview's improved page-margin sizing.
Download the source kit Release and verification evidence
An explicit preview installation
The API lives under fullbleed.ui.experimental and may change. The source kit
pins fullbleed==2.6.0a8; ordinary pip install fullbleed selects the stable
channel. Use Python 3.10 or later in a virtual environment.
Choose a starting point¶
| Document | Source in the kit | |
|---|---|---|
| Northstar invoice | One-page invoice | design_showcase/invoice_components.py and invoice.html |
| Common Ground report | Three-page report | design_showcase/report_components.py and report.html |
| Common Ground accessible guide | PDF/UA-1 · PDF/UA-2 | accessible_showcase/guide.py and guide.css |
The content is fictional. Northstar and the report each include HTML/CSS and component source for the same design. The guide shows headings, a captioned table, column headers, lists and an image description authored through components.
Recreate the documents¶
You can download the ZIP above or install the same source kit through Fullbleed's CLI. In an activated virtual environment, run:
python -m pip install "fullbleed==2.6.0a8"
fullbleed new remote component-showcase my-documents --version 0.1.3
cd my-documents
An existing stable CLI can also download the template. Template 0.1.3 selects
the source archive; its requirements.txt pins engine 2.6.0a8. The installer
checks the archive's SHA-256 before extracting files into an absent or empty
directory. It does not install dependencies or execute the source.
If you used the ZIP, open its fullbleed-component-showcases-2.6.0a8 folder.
From either project folder, with your virtual environment activated, run:
python -m pip install -r requirements.txt
python design_showcase/compare_authoring.py --out output/paired
python accessible_showcase/render.py --out output/accessible-ua1
python accessible_showcase/render.py --pdf-profile pdfua2 --out output/accessible-ua2
The paired command renders both designs through both authoring paths and compares
their PDF pages. It also writes styled and unstyled HTML. Edit the records in
design_showcase/data.json, reuse a component such as InvoiceField or
AmountDue, or compose another ProgramCard in the guide.
Fonts, illustrations and font licenses are included or supplied by the pinned Fullbleed package. PDF generation needs no browser or system fonts.
Give a component its appearance¶
Components can carry defaults and expose named styling parts. class_name
adds a literal CSS class; a matching rule supplies its appearance. For example:
from pathlib import Path
from fullbleed.ui.experimental import Document, style
from fullbleed.ui.experimental import bootstrap as bs
note = bs.Alert("Please retain this copy.", class_name="order-note")
document = Document(
note,
styles={".order-note": style(color="#205b47", border_color="#b8cec4")},
)
Path("note.html").write_text(document.to_html(include_styles=True), encoding="utf-8")
Path("note.unstyled.html").write_text(document.to_html(include_styles=False), encoding="utf-8")
Bootstrap components carry their default stylesheet. .with_style(...) changes
a component root; .with_parts(title=style(...)) targets an exposed internal
part. Unstyled HTML retains content, semantic elements and authored classes so
the host application can provide CSS. All Bootstrap components and exports are
static; no Bootstrap JavaScript is included.
See the current styling API and reusable component recipes. The paired-authoring guide, accessible-guide walkthrough and Bootstrap catalog retain their earlier, versioned examples and verification records.
What was verified¶
The release's source ZIP was extracted and executed using a fresh public PyPI installation. It reproduced the checked PDFs. Northstar's two authoring paths produce identical PDF bytes; Common Ground's report pages have identical pixels. Each accessible-guide profile produces identical PDF bytes through components and exported HTML/CSS, and passes independent veraPDF validation.
The release retains 943 Python tests, 1,451 native tests, 489 saved-PDF regression cases and validation evidence for 326 PDF/UA matrix fixtures. The complete CSS corpus remains failing, with 25 failed cases and 18 disputed references. Reports, checksums, limits and reproduction details are linked from the release.
These fixture checks do not establish accessibility for arbitrary documents or
human assistive-technology usability. Running-box measurements do not establish
complete painted-ink fit; transformed content and oversized descendants can
clip. PageBand and PageNumbers remain design proposals. The preview preserves
the deterministic print-document engine and static HTML export boundaries.