typst
Python binding to Typst, a new markup-based typesetting system that is powerful and easy to learn.
What it is and what it does
typst is a Python binding to the Typst typesetting system, allowing you to compile Typst markup documents programmatically from Python. It wraps the Typst compiler as a native extension, exposing functions to convert `.typ` files to PDF, PNG, SVG, or HTML output formats. The package supports single-file and multi-file projects, reproducible builds via fixed timestamps, query and eval operations for introspection, and passing runtime values into documents via `sys_inputs`.
The binding is implemented in Rust with stable ABI wheels (cp38-abi3) covering Python 3.8 through 3.14 on major platforms. It has no Python runtime dependencies, making it lightweight to deploy. Recent maintenance (last commit 2026-08-01, version 0.15.0 released 2026-06-16) and active status suggest ongoing development, though the license treatment remains unclear in the metadata.
Use it for:
- Generate PDFs or images from Typst templates in a web service or batch processing pipeline
- Embed Typst compilation into a Python documentation or report generation tool
- Build multi-file Typst projects programmatically by passing file dictionaries and package paths
- Query or evaluate Typst expressions to extract structured data from compiled documents
- Create reproducible document builds by fixing timestamps and controlling package caching
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compiles Typst markup documents to PDF, PNG, SVG, and HTML directly from Python, with support for multi-file projects and programmatic value passing.
Yes, with a license caveat. The package is actively maintained, has no runtime dependencies, and offers a clean Python API to a powerful typesetting system. Install friction is moderate due to compiled wheels, but prebuilt binaries cover most platforms. Before production use, clarify the actual license terms—the metadata provides no SPDX identifier or raw license text, only an 'unclear' classification.
Install
typst on PyPI
pip
pip install typstuv
uv add typstpoetry
poetry add typstInstalling typst
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (cp38-abi3 through cp314t). Active maintenance with recent release and repository activity. No runtime dependencies simplifies deployment.
License in practice
License treatment is unclear—no SPDX identifier or raw license text provided in metadata. Verify the actual license terms before use, particularly if integrating into proprietary or GPL-licensed projects.
Quickstart
import typst
# Compile Typst file to PDF
pdf_bytes = typst.compile("hello.typ")
# Or compile to PNG with custom resolution
images = typst.compile("hello.typ", output="hello{n}.png", format="png", ppi=144.0)
# Use Compiler class for repeated operations
compiler = typst.Compiler()
compiler.compile(input="hello.typ", format="svg")
Verify before relying
- Actual license identifier and terms (metadata shows unclear treatment with no SPDX or raw license provided)
- Whether compiled output (PDF, PNG, SVG) inherits any licensing constraints from Typst itself
- Performance characteristics and memory usage for large or complex documents
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 59 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 474,291/month — #6,454 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: typst-0.15.0-cp314-cp314t-macosx_10_12_x86_64.whl; typst-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl; typst-0.15.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; typst-0.15.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; typst-0.15.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; typst-0.15.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl; typst-0.15.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; typst-0.15.0-cp314-cp314t-win_amd64.whl; typst-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl; typst-0.15.0-cp38-abi3-macosx_11_0_arm64.whl; typst-0.15.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; typst-0.15.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; typst-0.15.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; typst-0.15.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; typst-0.15.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; typst-0.15.0-cp38-abi3-pyemscripten_2026_0_wasm32.whl; typst-0.15.0-cp38-abi3-win_amd64.whl
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
CairoSVGCairoSVG converts SVG files to PDF, EPS, PS,…
copyleft · top 5,000 on PyPI
sphinxcontrib-svg2pdfconverterConverts SVG images to PDF or PNG for Sphinx…
permissive · top 15,000 on PyPI
resvg_pyConverts SVG documents to raster image bytes…
unclear · top 5,000 on PyPI
fpdfGenerates PDF documents from Python code,…
copyleft · top 5,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
kaleidoKaleido generates static images (PNG, SVG, PDF,…
unclear · top 5,000 on PyPI
pccmPCCM manages Python-to-C++ code generation and…
permissive · top 15,000 on PyPI
qrcodeGenerates QR codes as images (PNG, SVG) or…
permissive · top 1,000 on PyPI
drawsvgProgrammatically generate SVG images and…
permissive · top 5,000 on PyPI
xhtml2pdfConverts HTML and CSS to PDF documents using…
permissive · top 5,000 on PyPI