Skip to main content

Python binding to typst

Project description

typst-py

CI PyPI

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

Installation

pip install typst

Usage

import typst


# Compile `hello.typ` to PDF and save as `hello.pdf`
typst.compile("hello.typ", output="hello.pdf")

# Compile `hello.typ` to PNG and save as `hello.png`
typst.compile("hello.typ", output="hello.png", format="png", ppi=144.0)

# Or return PDF content as bytes
pdf_bytes = typst.compile("hello.typ")

# Also for svg
svg_bytes = typst.compile("hello.typ", format="svg")

# Or use Compiler class to avoid reinitialization
compiler = typst.Compiler("hello.typ")
compiler.compile(format="png", ppi=144.0)

License

This work is released under the Apache-2.0 license. A copy of the license is provided in the LICENSE file.

Project details


Download files

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

Source Distribution

typst-0.11.0.tar.gz (4.7 MB view hashes)

Uploaded Source

Built Distributions

typst-0.11.0-cp37-abi3-win_amd64.whl (14.9 MB view hashes)

Uploaded CPython 3.7+ Windows x86-64

typst-0.11.0-cp37-abi3-win32.whl (14.5 MB view hashes)

Uploaded CPython 3.7+ Windows x86

typst-0.11.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

typst-0.11.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (20.0 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

typst-0.11.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (19.8 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

typst-0.11.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (18.2 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

typst-0.11.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (17.9 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

typst-0.11.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (18.9 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

typst-0.11.0-cp37-abi3-macosx_11_0_arm64.whl (15.4 MB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

typst-0.11.0-cp37-abi3-macosx_10_12_x86_64.whl (15.8 MB view hashes)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page