Skip to main content
Lpdf - PDF as Code

lpdfio-lpdf

Python SDK for Lpdf — PDF as Code on every platform

You describe a document as code or XML. Lpdf renders a compact, pixel-perfect PDF — identical across platforms.

Installation

pip install lpdfio-lpdf

Usage

from lpdf import L, NoAttr

engine = L.engine()

doc = L.document(DocumentAttr(size='letter', margin='48pt'), [
    L.section(NoAttr, [
        L.layout(NoAttr, [
            L.stack(StackAttr(gap='24pt'), [
                L.split(NoAttr, [
                    L.text(TextAttr(font_size='8pt', color='#888888'), ['ACME CORP']),
                    L.text(TextAttr(font_size='22pt', bold='true'), ['Project Proposal']),
                ]),
                L.divider(DividerAttr(thickness='xs')),
                L.text(TextAttr(font_size='13pt', bold='true'), ['Scope of Work']),
                L.flank(FlankAttr(gap='12pt', align='start'), [
                    L.text(TextAttr(color='#888888', width='24pt'), ['01']),
                    L.text(NoAttr, ['Discovery & Research']),
                ]),
            ]),
        ]),
    ]),
])

pdf = engine.render(doc)

Requirements

  • Python 3.8+
  • wasmtime CLI must be available in PATH (used to run the bundled WASI binary).

Versioning

The first two numbers are the Lpdf engine, and the last number counts changes to this package only. 0.22.3 runs engine 0.22, with three Python-only changes since that engine shipped. Every engine release publishes all SDKs at X.Y.0, so the same X.Y means the same engine in every language.

To stay on one engine and still get this package's fixes: pip install "lpdfio-lpdf~=0.22.0".

Docs

lpdf.io/docs/python

Issues

Report bugs and request features at github.com/lpdfio/lpdf/issues, the one tracker for the engine, the SDKs and the VS Code extension. Pull requests are not accepted.

--

Dual-licensed: Community License (free) and Commercial License (paid). See LICENSE for full terms.

Metadata

Release files for lpdfio-lpdf 0.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lpdfio-lpdf 0.20.0
File Size Uploaded
lpdfio_lpdf-0.20.0.tar.gz 27.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lpdfio-lpdf 0.20.0
File Interpreter ABI Platform
lpdfio_lpdf-0.20.0-py3-none-any.whl Python 3 none any Details

Total release size: 78.5 kB

Release files / lpdfio_lpdf-0.20.0.tar.gz

Download URL lpdfio_lpdf-0.20.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
80f0071ae9d74e6f36692a60c4a6f72807cc9936632a4b15ce896fd40cd185e8
BLAKE2b-256 checksum
How to use checksums
d37fd3ef77a1ba2bb055afa86c5544c258790fd510a1bc1a57fbd12a3df1d90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / lpdfio_lpdf-0.20.0-py3-none-any.whl

Download URL lpdfio_lpdf-0.20.0-py3-none-any.whl
Size 50.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc8d6ccbe9055ba5e4a04b5498b3ee2fc24444bccfc1a01f95c19e65565894fd
BLAKE2b-256 checksum
How to use checksums
0524656d03e01952759c9ddb983efeec96387a619c0261a4b13af5f1c20c23fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

0.22.0

2 release files

0.21.0

2 release files

This release

0.20.0 This release

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page