Python binding to typst
Project description
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
# 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")
# For multi-page export (the template is the same as the typst cli)
images = typst.compile("hello.typ", output="hello{n}.png", format="png")
# Or use Compiler class to avoid reinitialization
compiler = typst.Compiler("hello.typ")
compiler.compile(format="png", ppi=144.0)
# Query something
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file typst-0.11.1.tar.gz
.
File metadata
- Download URL: typst-0.11.1.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a336fef1dbec6ae678d87d680a90ad07c8739bc0599b54fdd7fa351a4efa56 |
|
MD5 | ad9b267ec61497a19708c2f443b2510e |
|
BLAKE2b-256 | ddd2732b5b29afae9aa58996719a5e555b19cc98815c728c63e24f4e0f046c7f |
File details
Details for the file typst-0.11.1-cp37-abi3-win_amd64.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 15.0 MB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3874f7910687406ee7e80de1aec58487c305b76893b50a3a869496105a5767a5 |
|
MD5 | a8a98122ee27436b3e0c9cd8beb63341 |
|
BLAKE2b-256 | 61a2df2b12b51fc13387377c371ac7518729c655d0c8eee02f8a6d85b0aa5efd |
File details
Details for the file typst-0.11.1-cp37-abi3-win32.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-win32.whl
- Upload date:
- Size: 14.5 MB
- Tags: CPython 3.7+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ccebab8f9fc49b2b212d6af0e349aa6cd8fc043c343bf5719aa1ef7dae354f |
|
MD5 | 082655ad65e48b91bebe672d17c99dc0 |
|
BLAKE2b-256 | 4442a2e36c7510c10db754ab915b4b3c05093c0ff0affdf67a5f96a777d130c6 |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 18.3 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef8e44bec7a2e168a92aec2fa8008328b630d137753c0550ba654c7855d2893a |
|
MD5 | 3f3a058700d26ead869cdc7f0492ef97 |
|
BLAKE2b-256 | 5adc16b646856753702d880b5af1207254cbd00ace25c4ae21cc67348e321448 |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 19.9 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffba53328e317b9b0a4e9d05573c98c7f7d4e555259e1ff5a9a2169a85232d71 |
|
MD5 | 9c0cb1fa1a8adb607988f3f6c7133806 |
|
BLAKE2b-256 | 6c329e6ef220c57d978200d9de1274c76f68cddcdac04a27e1b5d56108220bc5 |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 17.5 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75313042a605c15649f23eb074c5df34bca66f5b921cd043651afd80ff3ad9f0 |
|
MD5 | 32e5488ba8e87cd038446810ede12cf8 |
|
BLAKE2b-256 | a9573db50dca9d238255c9fb312af9359f5a684d4d7ee4f802a7f8097f93102a |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 19.0 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812b99f617aabb599508e132cdc881a751d89ad32504def774d3e3b765425872 |
|
MD5 | fd8017dc3993f6d8f7d7e0a5c8ccd002 |
|
BLAKE2b-256 | fb4f25db2c3a9f0a5f076ba6a482b33e2a67156a992c49d96dea8d58237ebd39 |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 18.2 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11c925fab98fdce6b3f8c498c399eed7224d7a315348aa46e2bb0d9a40af5baa |
|
MD5 | c24d8f9b02ed9f0190d0c04fe70d60b6 |
|
BLAKE2b-256 | 5bdac08f660004a3b1a29c71c6ceca4b5dd5bb1ee5e2d659200b5cb2a9bd564d |
File details
Details for the file typst-0.11.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 17.8 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d6bf84d7e1c8402241d10874a4dc4df4995dcff0a581c47b1def92cc4de322b |
|
MD5 | 1dc762731abca4bdac736004e4d9be34 |
|
BLAKE2b-256 | 8f1abff4316051320b860fe1be4366a68cdc92423c188074c9ebaeb5df68e320 |
File details
Details for the file typst-0.11.1-cp37-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 15.5 MB
- Tags: CPython 3.7+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8af0dabc95a761b07f19c4551da9176bc1b408a9abf9d5d0ab93da3d616abf6 |
|
MD5 | 6a278c052cf3139b3e2a30ef0378b669 |
|
BLAKE2b-256 | 7886de6f5e35b5d4babcbef9719c2afcd02ec3a4196d0da6bf521700bb49c003 |
File details
Details for the file typst-0.11.1-cp37-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: typst-0.11.1-cp37-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.7+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec50fc97f8afe6da1f8787a72f77f04ddf14e007c88a1b130cb8122a405e4e63 |
|
MD5 | ebf429a595b6d4a19e68aa71cc1de1c5 |
|
BLAKE2b-256 | 17ebe1c5d59399365c71b12fe5ea6bb0d87f5ca21e2bf001e7a3758fae3b0c23 |