typst-py
Python binding to typst,
a new markup-based typesetting system that is powerful and easy to learn.
Installation
pip install typst
Usage
import typst
typst.compile("hello.typ", output="hello.pdf")
typst.compile("hello.typ", output="hello.png", format="png", ppi=144.0)
pdf_bytes = typst.compile("hello.typ")
svg_bytes = typst.compile("hello.typ", format="svg")
images = typst.compile("hello.typ", output="hello{n}.png", format="png")
compiler = typst.Compiler("hello.typ")
compiler.compile(format="png", ppi=144.0)
import json
values = json.loads(typst.query("hello.typ", "<note>", field="value", one=True))
License
This work is released under the Apache-2.0 license. A copy of the license is provided in the LICENSE file.