Metadata-Version: 2.4
Name: typy
Version: 0.8.2
Author-email: Manuel Goulão <msilvagoulao@gmail.com>
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typst>=0.14
Requires-Dist: pydantic<3.0.0,>=2.11.3
Requires-Dist: typer<1.0.0,>=0.12.0
Requires-Dist: rich<15.0.0,>=13.0.0
Provides-Extra: pandas
Requires-Dist: pandas<3.0,>=2.0; extra == "pandas"
Dynamic: license-file

# typy

typy is a Python library for generating polished PDFs with Typst.
It provides:

- a typed Python API
- a CLI for quick rendering workflows
- reusable built-in templates (report, invoice, letter, CV, presentation, and more)

> [!WARNING]
> typy is still experimental and APIs may change between releases.

| report | invoice | letter |
|---|---|---|
| [![report](./assets/previews/report.png)](examples/report/report.py) | [![invoice](./assets/previews/invoice.png)](examples/invoice/invoice.py) | [![letter](./assets/previews/letter.png)](examples/letter/letter.py) |
| **cv** | **academic** | **presentation** |
| [![cv](./assets/previews/cv.png)](examples/cv/cv.py) | [![academic](./assets/previews/academic.png)](examples/academic/academic.py) | [![presentation](./assets/previews/presentation.png)](examples/presentation/presentation.py) |
| **basic** | | |

## Install

```bash
pip install git+https://github.com/mgoulao/typy
```

## Quick start (CLI)

```bash
typy scaffold report --output data.json
typy render --template report --data data.json --output report.pdf
```

## Quick start (Python)

```python
from typy.builder import DocumentBuilder
from typy.templates import BasicTemplate

template = BasicTemplate(
    title="Hello typy",
    date="2026-04-24",
    author="Your Name",
    body="## Welcome\n\nThis PDF was generated from Python.",
)

DocumentBuilder().add_template(template).save_pdf("hello-typy.pdf")
```

## Documentation

Published documentation website: [mgoulao.github.io/typy](https://mgoulao.github.io/typy/)

Source docs in this repository:

- [Getting started](https://mgoulao.github.io/typy/getting-started.html)
- [Cookbook](https://mgoulao.github.io/typy/cookbook.html)
- [Template reference](https://mgoulao.github.io/typy/templates.html)
- [CLI reference](https://mgoulao.github.io/typy/cli.html)
- [API reference](https://mgoulao.github.io/typy/api.html)
- [Package format](https://mgoulao.github.io/typy/package-format.html)
- [LLM-oriented docs](https://mgoulao.github.io/typy/llm.html)

## Examples

Runnable examples are in [examples/](examples/):

- [basic](examples/basic/basic.py)
- [report](examples/report/report.py)
- [invoice](examples/invoice/invoice.py)
- [letter](examples/letter/letter.py)
- [presentation](examples/presentation/presentation.py)
- [academic](examples/academic/academic.py)
- [cv](examples/cv/cv.py)

## Contributing and development

Contributor workflows (tests, linting, docs build, and release practices) are documented in [DEVELOPMENT.md](DEVELOPMENT.md).
