Live data from Hacker News

Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

news.ycombinator.com

1–10 of 329 posts

Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#1
Hi! We’re Nikhil and Alek, founders of Pynecone (https://pynecone.io), an open source framework to build web apps in pure Python. This can be anything from a small data science/internal app to a large multi-page web app. Once your app is built, you can deploy your app with a single command to our hosting service (coming soon!), or self-host with your preferred provider.

Our Github is: https://github.com/pynecone-io/pynecone

Python is one of the most popular programming languages in the world. Webdev is one of the most popular applications of programming. So why can’t we make full-stack web apps using just Python?

We worked in the AI/infra space and saw that even skilled engineers who wanted to make web apps but didn’t know traditional frontend tools like Javascript or React found it overwhelming and time consuming to learn. On the other hand, no code and low code solutions that save time in the development process lack the flexibility and robustness of traditional web development. These tools are great for prototyping, but they can be limiting as your app becomes more complex. We wanted to build a framework that is easy to get started with, yet flexible and powerful enough so you don’t outgrow it. Our main website is fully built with Pynecone and deployed on our hosting service.

In Pynecone, the frontend compiles down to a React/NextJS app, so from the end-user’s perspective it looks like any other website. We have 60+ built-in components ranging from forms to graphing. Components are defined as Python functions. They can be nested within each other for flexible layouts, and you can use keyword args to style them with full CSS. We also provide a way to easily wrap any existing React component. Our goal is to leverage the existing webdev ecosystem and make it accessible to Python devs.

The app state is just a class. State updates are functions in the class. And the UI is a reflection of the state. When the user opens the app, they are given a unique token and a new instance of the state. We store user state on the backend, and use Websockets to send events and state updates. When a user performs an action, such as clicking a button, an event is sent to the server with the client token and the function to handle the event. On the server side, we retrieve the user's state, execute the function to update the state, then send the updated state back to the frontend for rendering. Since Pynecone is 100% Python, you can easily integrate all your existing Python libraries into your app. In the future, we hope to leverage WebAssembly to offload many operations to the client.

Once your app is built, the next big challenge is deploying it. We’re building a single-line deploy, so you can type pc deploy and get a URL of your live app in minutes. Since we specialize in hosting a single type of app, we aim to provide a zero configuration deployment process. We are still working on releasing the hosting service, but you can sign up for its waitlist on our homepage. Alternatively, you can choose to host your app with your preferred cloud provider.

Things users have built with Pynecone so far include internal apps ranging from CRM to ML tools, UIs for LLM apps, landing pages, and personal websites. If you use Python, we would love to hear your thoughts and feedback in the comments!

Re: Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#4
post #2

I've tested Pynecone recently and it's pretty good. I'm wondering how do you intend to create a business around this library.

Thanks! We're building a hosting service that you can deploy your apps to. Our plan is to have a free tier for your first app, then charge for additional apps. We're still finalizing this, so would love to hear any thoughts.

Re: Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#5

Why should I choose this over Django or Flask? By using Python in the frontend you mean the Python is transpiled into JS? The frontend uses templating or generates a SPA app?

> In Pynecone, the frontend compiles down to a React/NextJS app

Re: Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#6

Why should I choose this over Django or Flask? By using Python in the frontend you mean the Python is transpiled into JS? The frontend uses templating or generates a SPA app?

Yes, in Pynecone you write your frontend in Python and it's compiled to a SPA, plus a FastAPI backend server to handle state updates. Django and Flask handle the backend in Python, but you still have to use Javascript for the frontend.

Re: Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#7

Why should I choose this over Django or Flask? By using Python in the frontend you mean the Python is transpiled into JS? The frontend uses templating or generates a SPA app?

Not affiliated, but this isn't just a Back-end API that supports delivering html- it's much more similar to streamlit afaict.

Here's one of their examples https://pynecone.io/docs/getting-started/introduction

Re: Launch HN: Pynecone (YC W23) – Web Apps in Pure Python

#8
I'd love to see something like this. I'm an old computer science guy and would love to write software again. I can write plenty of functionality in Python but I don't really want to learn all the JS stuff. I just don't like it. If I could abstract away the details it would be a big help. I'm not going to build anything that requires scale or commercial performance so I can afford to compromise versus the "purity" of having your own stack.
Post reply on HN