PDF templating with Typst
Project description
Oicana
Dynamic PDF Generation based on Typst.
Oicana offers seamless PDF templating. Define your templates in Typst, specify dynamic inputs, and generate high quality PDFs from your application code.
Installation
pip install oicana
Quick Start
import json
from oicana import Template, CompilationMode
# Load your template
with open("template.zip", "rb") as f:
template_bytes = f.read()
# Create template and compile
with Template(template_bytes) as template:
pdf = template.compile(
json_inputs={
"invoice": json.dumps({
"number": "INV-001",
"items": [{"name": "Service", "price": 100}]
})
},
export={"format": "pdf"},
mode=CompilationMode.PRODUCTION,
)
# Save the PDF
with open("output.pdf", "wb") as f:
f.write(pdf)
Features
- Multi-platform: Works on Linux, macOS, and Windows
- Powerful Layouting: Full access to Typst's functionality
- Performant: Native Rust performance via PyO3
- Type Safe: Full type hints for IDE support
- Pythonic: Context managers, dataclasses, and enums
Documentation
For more information, visit https://docs.oicana.com
License
This project is licensed under the PolyForm Noncommercial License 1.0.0. See the LICENSE.md file for details.
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oicana-0.1.0a3.tar.gz.
File metadata
- Download URL: oicana-0.1.0a3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59e734517217c2b0e9a0afebf054856ee65f4997dd6a90458ef98ff99ac6c2a2
|
|
| MD5 |
36c7638e57b2dfede48dce0b14d509f9
|
|
| BLAKE2b-256 |
7bab18b1daab190cde6eb370e28dbc1428098fd6ba9d5a6341e3f93af7955727
|
Provenance
The following attestation bundles were made for oicana-0.1.0a3.tar.gz:
Publisher:
publish-integration-python.yml on oicana/oicana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oicana-0.1.0a3.tar.gz -
Subject digest:
59e734517217c2b0e9a0afebf054856ee65f4997dd6a90458ef98ff99ac6c2a2 - Sigstore transparency entry: 777847419
- Sigstore integration time:
-
Permalink:
oicana/oicana@5ef26732817b5026987c4dbfac3d088271b2114a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oicana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-integration-python.yml@5ef26732817b5026987c4dbfac3d088271b2114a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file oicana-0.1.0a3-py3-none-any.whl.
File metadata
- Download URL: oicana-0.1.0a3-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
121c7a063507a4cb0f1814299be89c5806c4937a4ddc25db3b2d46a2922ea287
|
|
| MD5 |
603561e8898ebd78f6c9b9ec2fbd0c4b
|
|
| BLAKE2b-256 |
d99e8c00ff40ef4af14c3e348277972259f36a391b3ab6554bbe8ea03661f4ed
|
Provenance
The following attestation bundles were made for oicana-0.1.0a3-py3-none-any.whl:
Publisher:
publish-integration-python.yml on oicana/oicana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oicana-0.1.0a3-py3-none-any.whl -
Subject digest:
121c7a063507a4cb0f1814299be89c5806c4937a4ddc25db3b2d46a2922ea287 - Sigstore transparency entry: 777847420
- Sigstore integration time:
-
Permalink:
oicana/oicana@5ef26732817b5026987c4dbfac3d088271b2114a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oicana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-integration-python.yml@5ef26732817b5026987c4dbfac3d088271b2114a -
Trigger Event:
workflow_dispatch
-
Statement type: