Skip to main content

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={"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


Download files

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

Source Distribution

oicana-0.1.0a2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oicana-0.1.0a2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file oicana-0.1.0a2.tar.gz.

File metadata

  • Download URL: oicana-0.1.0a2.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

Hashes for oicana-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 0d05c7f78b5ccf94015a152f2f06bb47386d4698fad1f62991d70739d5a50ef9
MD5 b89874c112a213c35f9acd28c46e987f
BLAKE2b-256 21464174b344bfaa6a4b9c8f01b6e51b74f145527267a3b916a4c0d5dd938ca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for oicana-0.1.0a2.tar.gz:

Publisher: publish-integration-python.yml on oicana/oicana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oicana-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: oicana-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for oicana-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d449e1b98402f0065c95e5234babc2baac5b1996f2c417abe35d40ad5d55bee
MD5 db44ea63b7d635753a68977946630267
BLAKE2b-256 ae1b632770af57516ecadca2804668b893fb7b59204bf7d4d440281bd6be98e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for oicana-0.1.0a2-py3-none-any.whl:

Publisher: publish-integration-python.yml on oicana/oicana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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