frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Typol – Static typing layer for Polars

https://github.com/pdtpartners/typol
4•mrrpdt•19h ago
Hello! Wanted to share Typol, a thin static typing layer around Polars that lets you enforce columnar schemas. We've been hesitant in the past to go with dataframes for processing reporting data, especially with Pandas, due to the long-term maintainability burden of tooling not understanding the data we're processing, or the library itself. Polars is well typed and encourages constructing shapes up rather than modifying in-place, so adding schema typing to it seemed like a natural extension. If Polars DataFrames are dicts, then Typol's are TypedDicts.

With Typol, it's easy to define your schemas, which should feel familiar if you're moving from dataclass-style code or from Polars' own schemas, and then build well-typed Polars expressions on these that enforce: (1) valid columns are referenced, (2) column values are used in a valid way for their type, and (3) expressions generate target valid columns in resulting schemas with the correct type.

  class Account(tp.Shape):
      name = tp.dimension(str)
      website = tp.dimension(str)
      uid = tp.dimension(int)

  # Works, with the type: Expr[Account, Account, str]
  email_address = accounts.s.name.str.to_lowercase() + "@" + accounts.s.website

  # Caught statically:
  # Unsupported `+` operation: `BoundDimension[Account, int]` + `Literal["@"]`
  email_address = accounts.s.uid + "@" + accounts.s.website
These types are checked statically using ty, which supports spelling the intersection types needed to infer join results, with a little dynamic enforcement filling in where static analysis can't reach. This allows you to make use of tooling both to check and guide your code (dot completion coming in handy). Existing tools, like Pandera, do provide dynamic verification of dataframe shapes. Whilst this can be good, it bites you at runtime which is well after a problem should be caught, and doesn't provide any tooling benefit.

Typol is great for production data processing pipelines, where narrowing your data to well-defined schemas at each processing stage can be appropriate and powerful. It's not well suited to a lot of data science, where columns generally get added and dropped quite freely. It covers most core Polars expression operations (laziness, arithmetic, strings, datetimes, lists, filtering, joins, aggregations), but we'd love to extend it further, and we'd love for you to try it out!

Comments

diziet_sma•1h ago
Very cool! I would imagine this helps LLMs catch errors while refactoring code.

How hard is it to migrate existing pandas/Polars code to Typol?

Most importantly, how did you come up with the name?

mrrpdt•31m ago
Definitely one of the advantages of improved tooling visibility, tooling's importance here is obstensibly one of the reasons for the recent acquisition of Astral.

Migrating Pandas to canonical Polars can require some rethinking, since Polars couldn't make a cleaner API model without making things different. From Polars to Typol can really depend: if you have relatively fixed `pl.Schema`s which you join, filter, aggregate, transform between etc., then it should be pretty trivial; the interface is specifically designed to deviate from Polars only where necessary or there is particularly strong case ergonomically. If you really need to add and drop columns all the time, then it might require some more effort. Worst case, you can always have the intermediates in some of your functions still be in Polars, but expose the right shapes with Typol. It's trivial to switch back and forward by doing `typol_df.dataframe` and `tp.DataFrame(MyShape, polars_df)`. This way you're enforcing shape types between sections of your code, and can push that typing inside your functions later.

Naming can end up as a bit of bikeshedding, but if you're interested, right now it needs Ty (until other checkers support intersections), and it's based on Polars, so Ty+Pol seemed the most obvious to users and Googleable.

Show HN: Background Be Gone – Free App and CLI for Bg Removal on Mac

https://bgbgone.franzai.com
2•franze•25m ago•3 comments

Show HN: I Derived a Pancake

https://www.absurdlyoptimized.com/recipes/pancakes/
274•bkazez•3d ago•109 comments

Show HN: Lathe – Use LLMs to learn a new domain, not skip past it

https://github.com/devenjarvis/lathe
349•devenjarvis•1d ago•62 comments

Show HN: Nightwatch, The open-source, read-only AI SRE

https://github.com/ninoxAI/nightwatch
25•egorferber•17h ago•9 comments

Show HN: Kyushu – A self-hostable WASM sandbox for JavaScript workers

https://kyushu.dev/
80•le_chuck•1d ago•33 comments

Show HN: Infinite canvas notes in the non-Euclidean Poincaré disk

https://uonr.github.io/poincake/
186•uonr•5d ago•32 comments

Show HN: Free animated icon library for Vue

https://respeak-io.github.io/lucide-motion-vue/
58•evolabs•4d ago•18 comments

Show HN: OpenPayphone – open-source guts for a 1996 coin payphone (Pi and SIP)

https://github.com/eric-cgn/openpayphone
19•mcintyem•21h ago•1 comments

Show HN: NoSuggest – Watch YouTube without the recommendation algorithm

https://www.nosuggest.com/
51•VJ-2-108•4d ago•51 comments

Show HN: Formally verified polygon intersection – Opus 4.8 oneshots, prev failed

https://github.com/schildep/verified-polygon-intersection
91•permute•3d ago•21 comments

Show HN: Oproxy – inspect and modify network traffic from the browser

https://github.com/sauravrao637/oproxy
66•sauravrao637•1d ago•12 comments

Show HN: Web Speed – A shared web-map registry for AI agents (MCP, open source)

https://www.getwebspeed.io/
6•Dominic_P•9h ago•3 comments

Show HN: Lowfat – pluggable CLI filter that saved 91.8% of my LLM tokens

https://github.com/zdk/lowfat
153•zdkaster•3d ago•76 comments

Show HN: Avibe – your AI agent lives on your machine, reachable from your phone

https://github.com/avibe-bot/avibe
4•alex_metacraft•9h ago•1 comments

Show HN: I put my Claude Code rate-limit burndown in the status line

https://www.aimhuge.com/blog/claude-code-status-line
6•fotoflo•10h ago•2 comments

Show HN: One resume for one job description

https://nailtherole.com
4•tigerkid•11h ago•2 comments

Show HN: Inbox-beam – notifications in your inbox without sending email

https://github.com/toyoshi/inbox-beam
12•toyoshi•1d ago•2 comments

Show HN: An mkv player that uses WASM to render you videos

https://parallax.kinosoft.moe/
3•kafkaesqueKino•14h ago•0 comments

Show HN: Edsger – A handwritten Clojure REPL for the reMarkable 2

https://handwritten.danieljanus.pl/2026-06-01-edsger.html
260•nathell•5d ago•34 comments

Show HN: GentleOS – A pair of hobby OSes for vintage 32-bit and 16-bit PCs

https://github.com/luke8086/gentleos32
9•luke8086•22h ago•0 comments

Show HN: A parser for the ISO 10303 EXPRESS language for its 40th anniversary

https://github.com/rochus-keller/EXPRESS
6•Rochus•22h ago•0 comments

Show HN: A virtual thermal printer for testing ESC/POS receipts

https://vprinter.dev
6•seokjume•1d ago•0 comments

Show HN: Keybench – Scriptable, extensible performance tool for key value stores

https://github.com/guycipher/keybench
13•alexpadula•1d ago•0 comments

Show HN: ABC Classic 100 Rankings visualised

https://classic100.gotski.workers.dev/
36•gotski•2d ago•19 comments

Show HN: Typol – Static typing layer for Polars

https://github.com/pdtpartners/typol
4•mrrpdt•19h ago•2 comments

Show HN I scraped 743 large employers' careers pages to find their ATS

https://github.com/Kayvan-Zahiri/state-of-ats-2026
3•kzahiri•20h ago•2 comments

Show HN: On-device transcriber that's 97% accurate at identifying speakers

https://mimicscribe.app/
29•marshalla•2d ago•9 comments

Show HN: Uruky (EU-based Kagi alternative) now has Image Search and URL Rewrites

https://uruky.com/?il=en
234•BrunoBernardino•4d ago•231 comments

Show HN: Help SourceLibrary.org Translate the Renaissance

https://sourcelibrary.org
8•dr_dshiv•22h ago•0 comments

Show HN: Sudo Report – Drudge clone for tech / AI / product

https://sudoreport.com/
3•ataturkle•22h ago•5 comments