I built a tiny tool to convert Pydantic models to TypeScript. What do you think?

Posted by TheFitDev@reddit | Python | View on Reddit | 17 comments

At work we use FastAPI and Next.js, and I often need to turn Pydantic models into TypeScript for the frontend. Doing it by hand every time was boring, slow, and easy to mess up so I built a small app to do it for me.

What My Project Does

My project is a simple website that converts your Python Pydantic models into clean TypeScript code. You just paste your Pydantic code, and it instantly gives you the TypeScript version. It all happens right in your browser, so your code is safe and never saved. This saves you from having to manually type out all the interfaces, which is boring and easy to mess up.

Target Audience

This is for developers who use FastAPI on the backend and TypeScript (with frameworks like Next.js or React) on the frontend. It's a professional tool meant to be used in real projects to keep the backend and frontend in sync.

Comparison

There are other tools out there, but they usually require you to install them and use your computer's command line. My tool is different because it's a website. You don't have to install anything, which makes it super quick and easy to use for a fast conversion. Plus, because it runs in your browser, you know your code is private.

It’s saved me a bunch of time and keeps backend and frontend in sync. If you do the same stack or use typescript, you might find it handy too.
Github: https://github.com/sushpawar001/pydantic-typescript-converter
Check it out: https://pydantic-typescript-converter.vercel.app/
Would love feedback and ideas!

PS: Not gonna lie I have significantly used AI to build this. (Not vibe coded though)