Python wrapper for folio HTML-to-PDF generator via PyO3 Rust extension
Project description
gofolio
Python wrapper for folio — a Go HTML-to-PDF library — exposed via a PyO3 Rust extension.
Installation
pip install gofolio
CLI usage
gf convert --input report.html --output report.pdf \
--page-size a4 \
--margin-top 20 --margin-bottom 20 --margin-left 15 --margin-right 15 \
--header-text "Confidential" \
--footer-text "Page {page} of {total}" \
--title "Q1 Report"
Python API
from gofolio._gofolio import convert_html_to_pdf
convert_html_to_pdf(
html="<h1>Hello</h1><p>World</p>",
output_path="output.pdf",
page_size="a4", # a4 | a3 | letter | legal
margin_top=20.0, # mm
margin_bottom=20.0,
margin_left=15.0,
margin_right=15.0,
header_text="My Header",
footer_text="Page {page} of {total}",
title="My Document",
)
Requirements
- Python 3.12+
- Go 1.21+ (build-time only)
- Rust stable (build-time only)
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 7.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a52ff5b7ad18ebb466f32a2ca12ed81d6540672020597df8c65993a0d6fa1b4
|
|
| MD5 |
f74e9300837300f777c61c5129f482a7
|
|
| BLAKE2b-256 |
8984c35a5f9438548299ae7a28546dace2bd80299f5e355bf26bd571b52b8f2f
|
Provenance
The following attestation bundles were made for gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl:
Publisher:
workflow.yml on abbazs/pyfolio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl -
Subject digest:
0a52ff5b7ad18ebb466f32a2ca12ed81d6540672020597df8c65993a0d6fa1b4 - Sigstore transparency entry: 1303673756
- Sigstore integration time:
-
Permalink:
abbazs/pyfolio@4a1a35615faef19cab510927f7fe5a564c75931b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/abbazs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4a1a35615faef19cab510927f7fe5a564c75931b -
Trigger Event:
push
-
Statement type:
File details
Details for the file gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 192.2 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7eb6475af03866f33d3e1bbfebac4409bbde5cd3fc91b2d308e772c4fbbd9c8
|
|
| MD5 |
3faac04d88fbbd7959b8e3d55ac6ea69
|
|
| BLAKE2b-256 |
c156245933b811872f6fd32947b9b083481f7db8910abdc64fce0905f686a6ee
|
Provenance
The following attestation bundles were made for gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
workflow.yml on abbazs/pyfolio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
e7eb6475af03866f33d3e1bbfebac4409bbde5cd3fc91b2d308e772c4fbbd9c8 - Sigstore transparency entry: 1303673994
- Sigstore integration time:
-
Permalink:
abbazs/pyfolio@4a1a35615faef19cab510927f7fe5a564c75931b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/abbazs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4a1a35615faef19cab510927f7fe5a564c75931b -
Trigger Event:
push
-
Statement type: