Python绑定到typst
项目描述
typst-py
Python绑定到typst,这是一个功能强大且易于学习的基于标记的排版系统。
安装
pip install typst
使用
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))
许可
此作品根据Apache-2.0许可发布。许可文件的副本在LICENSE文件中提供。
项目详情
下载文件
下载适合您平台的应用程序文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。
源代码分发
typst-0.11.1.tar.gz (4.7 MB 查看哈希值)
构建分发
typst-0.11.1-cp37-abi3-win_amd64.whl (15.0 MB 查看哈希值)
typst-0.11.1-cp37-abi3-win32.whl (14.5 MB 查看哈希)
关闭
typst-0.11.1.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 56a336fef1dbec6ae678d87d680a90ad07c8739bc0599b54fdd7fa351a4efa56 |
|
MD5 | ad9b267ec61497a19708c2f443b2510e |
|
BLAKE2b-256 | ddd2732b5b29afae9aa58996719a5e555b19cc98815c728c63e24f4e0f046c7f |
关闭
typst-0.11.1-cp37-abi3-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3874f7910687406ee7e80de1aec58487c305b76893b50a3a869496105a5767a5 |
|
MD5 | a8a98122ee27436b3e0c9cd8beb63341 |
|
BLAKE2b-256 | 61a2df2b12b51fc13387377c371ac7518729c655d0c8eee02f8a6d85b0aa5efd |
关闭
typst-0.11.1-cp37-abi3-win32.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e2ccebab8f9fc49b2b212d6af0e349aa6cd8fc043c343bf5719aa1ef7dae354f |
|
MD5 | 082655ad65e48b91bebe672d17c99dc0 |
|
BLAKE2b-256 | 4442a2e36c7510c10db754ab915b4b3c05093c0ff0affdf67a5f96a777d130c6 |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ef8e44bec7a2e168a92aec2fa8008328b630d137753c0550ba654c7855d2893a |
|
MD5 | 3f3a058700d26ead869cdc7f0492ef97 |
|
BLAKE2b-256 | 5adc16b646856753702d880b5af1207254cbd00ace25c4ae21cc67348e321448 |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ffba53328e317b9b0a4e9d05573c98c7f7d4e555259e1ff5a9a2169a85232d71 |
|
MD5 | 9c0cb1fa1a8adb607988f3f6c7133806 |
|
BLAKE2b-256 | 6c329e6ef220c57d978200d9de1274c76f68cddcdac04a27e1b5d56108220bc5 |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 75313042a605c15649f23eb074c5df34bca66f5b921cd043651afd80ff3ad9f0 |
|
MD5 | 32e5488ba8e87cd038446810ede12cf8 |
|
BLAKE2b-256 | a9573db50dca9d238255c9fb312af9359f5a684d4d7ee4f802a7f8097f93102a |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 812b99f617aabb599508e132cdc881a751d89ad32504def774d3e3b765425872 |
|
MD5 | fd8017dc3993f6d8f7d7e0a5c8ccd002 |
|
BLAKE2b-256 | fb4f25db2c3a9f0a5f076ba6a482b33e2a67156a992c49d96dea8d58237ebd39 |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 11c925fab98fdce6b3f8c498c399eed7224d7a315348aa46e2bb0d9a40af5baa |
|
MD5 | c24d8f9b02ed9f0190d0c04fe70d60b6 |
|
BLAKE2b-256 | 5bdac08f660004a3b1a29c71c6ceca4b5dd5bb1ee5e2d659200b5cb2a9bd564d |
关闭
typst-0.11.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3d6bf84d7e1c8402241d10874a4dc4df4995dcff0a581c47b1def92cc4de322b |
|
MD5 | 1dc762731abca4bdac736004e4d9be34 |
|
BLAKE2b-256 | 8f1abff4316051320b860fe1be4366a68cdc92423c188074c9ebaeb5df68e320 |
关闭
typst-0.11.1-cp37-abi3-macosx_11_0_arm64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c8af0dabc95a761b07f19c4551da9176bc1b408a9abf9d5d0ab93da3d616abf6 |
|
MD5 | 6a278c052cf3139b3e2a30ef0378b669 |
|
BLAKE2b-256 | 7886de6f5e35b5d4babcbef9719c2afcd02ec3a4196d0da6bf521700bb49c003 |
关闭
typst-0.11.1-cp37-abi3-macosx_10_12_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ec50fc97f8afe6da1f8787a72f77f04ddf14e007c88a1b130cb8122a405e4e63 |
|
MD5 | ebf429a595b6d4a19e68aa71cc1de1c5 |
|
BLAKE2b-256 | 17ebe1c5d59399365c71b12fe5ea6bb0d87f5ca21e2bf001e7a3758fae3b0c23 |