Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (192.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gofolio-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0a52ff5b7ad18ebb466f32a2ca12ed81d6540672020597df8c65993a0d6fa1b4
MD5 f74e9300837300f777c61c5129f482a7
BLAKE2b-256 8984c35a5f9438548299ae7a28546dace2bd80299f5e355bf26bd571b52b8f2f

See more details on using hashes here.

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

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

File details

Details for the file gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gofolio-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7eb6475af03866f33d3e1bbfebac4409bbde5cd3fc91b2d308e772c4fbbd9c8
MD5 3faac04d88fbbd7959b8e3d55ac6ea69
BLAKE2b-256 c156245933b811872f6fd32947b9b083481f7db8910abdc64fce0905f686a6ee

See more details on using hashes here.

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

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