skillfed

typst

Python binding to Typst, a new markup-based typesetting system that is powerful and easy to learn.

typst v0.15.0 474.3K downloads/30d#6,454 on PyPI342
License unclear Active released

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 typst

uv

uv add typst

poetry

poetry add typst

Installing 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

Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Rust

Tags

typst document compilation pythonmarkup to pdf convertertypst python bindingdocument generation typesettingtypst cli python wrappercompile markup to imagetypst query eval python
document-generationtypesettingrust-binding

More Markup packages