Typst in production: turning data into deliverables

Joseph Barbier - Typst meetup, 2026

Typst Data science in production

This is not about Typst*…

(*thanks to Typst!)

  • I don’t have any tips
  • No best-practice recommendations
  • TLDR: if you’re here, you likely know more Typst than me!

… it’s all about reproducibility



  • Will it work on someone else’s machine?
  • Will it work 1 year from now?
  • Will it work with new data?
  • Can someone less technical run it too?

About


Consulting

Open source

Data(viz)

Projects



  • 1 - Typst on the client
  • 2 - Typst on the server

1 - Child vaccination in the US

Project description

made with Clarity Data Studio


  • 50 reports (1 per US state)
  • Stack: R + Quarto

Quarto





Reports

How it works

Now


Single R script that:

  • installs dependencies
  • renders 50 reports
  • puts them into a Google Drive

Learn more about this project




Code + Data + Doc

github.com/claritydatastudio/state-immunization-reports

2 - Assessing psychosocial risks among French workers

Context: psychosocial risk assessment at work

  • French employers are legally required to assess psychosocial risks, but:
    • enforcement is limited
    • practical guidance is often unclear
    • external consulting can be expensive

Approach

  • Run an anonymous survey across the company
  • Build a report from the responses

That’s the core idea.

In practice, it’s more complex…

  • Survey is long (70+ questions)
  • Results must be easy to consume (charts, summary, etc.)
  • Fully anonymous
  • Actionable (what should we do next?)

Solution

What about Typst?

We run Typst on the backend using typst-py

import json
import typst

# ID of the company
companyid = get_company_id() 

# create PNG files for the report
generate_all_chart(companyid) 

# summary, what to do next, etc
insights = generate_insights(companyid) 

sys_inputs = {
  "companyid": json.dumps(companyid)
  "insights": json.dumps(insights)
}
typst.compile(
    "src/document/template.typ",
    output="report.pdf",
    sys_inputs=sys_inputs,
)

Tech stack (PoC, not stable)

  • Backend: Python (FastAPI for the API, matplotlib for dataviz, polars & sqlalchemy for data, …)
  • Frontend: native HTML/CSS/JS
  • DB: Postgres

–> Future stack (?):

  • React/Next on the frontend, for simplicity
  • Rust (framework TBD) for the backend because performance and memory usage can be issues here

Have thoughts? Please share them!

What Typst lets me do

I’m not a software developer

  • I love to code, but…
  • My clients do not care about my tech stack, they just want to “consume” data easily
  • I don’t want code to be a limiting factor for what I’m trying to do

How I used to make PDFs*

.toc a::after {
  content: target-counter(attr(href), page);
  float: right;
  background: var(--background-color);
}
.toc .leaders::before {
  content: "";
}
.toc-section-number {
  margin-right: 15px;
  font-family: var(--secondary-font);
}


#TOC li {
  border-top: 1px solid #ccc !important;
  padding: 5pt;
  list-style-type: none;
}
#TOC li a {
  color: var(--primary-color) !important;
  text-decoration: none;
}


*real code used by some of my clients

Typst makes me forget about the report

  • I create a Typst template with the design I want, and that’s it!
    • it’s easy and fast
    • bindings everywhere
  • I can just focus on what matters to the clients/users

Thanks for listening!


Did I say something wrong?

  • come chat!

Did I say anything relevant?

  • come chat!


Other?