Skip to main content

Typenaut

Typst documents from python classes

[!WARNING] This project is no longer maintained:

  • Typst's native sys.inputs solved my needs, feeding pydantic models for dynamic content.
  • Not worth it to mirror what typst already does internally - it's turtles all the way down!
  • Pure library usage will likely improve in the future with community or official effort.

I'm archiving the repository as it got some clever tricks and a rough idea in how a meta programming library and utils would look like. Feel free to base off a continuation or rewrite under the MIT license (requires including original copyright notice and attribution).

Since I own the PyPI package, get in touch for a name transfer for any purpose shall you be worthy!

Note: Please change the logo on a fork, as I will use it elsewhere planned.

🔥 Description

An experiment on typst metaprogramming within python for heavy templating.

from typenaut import Document, Rectangle, Text

class Minimal(Document):
    def build(self):
        with Rectangle(self) as rect:
            Text(rect, value="Hi, I'm inside the rectangle")

# Automated usage!
document = Minimal()
document.build()
document.pdf(output="output.pdf")

🚀 Usage

Your best chance is on exploring the examples directory likely for a good while.

  • Upstream typst documentation is always a valuable resource!

Note: I really do not have the time to write structured documentation, but the code contains quality type hints and docstrings.

Metadata

Release files for typenaut 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for typenaut 0.0.2
File Interpreter ABI Platform
typenaut-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / typenaut-0.0.2-py3-none-any.whl

Download URL typenaut-0.0.2-py3-none-any.whl
Size 71.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e3283955b964db8857cf97c51360ac745ced6f1c5810b894660d7ee89463544
BLAKE2b-256 checksum
How to use checksums
7497fdf034968007dbe5e6ac97727ed0ca39c8387604dd2860fe4678eac728f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page