8 ms·
Pynecone – Performant, customizable web apps in pure Python
- PurpleRamen 3y agoAfter testing it a bit, why the f** is this so wasteful? Just starting the base helloworld-project is already wasting 30% CPU on idle. And apparently is running multiple servers, so I'm not even sure whether this is the whole story. How do they except anyone do use this for real?
- anigbrowl 3y agoIt’s just Python. The app state is just a class. State updates are methods in the class. And the UI is a reflection of the state. It's rare to see this sort of clarity on a landing page. Even more impressed to see that it carried over into the documentation, which is excellent. I've been a fan of the plotly/Dash framework, but this looks like an exciting alternative, feeling more immediately accessible without some of the quirks (like the pragmatic but weird-feeling 12 virtual columns, for example). I look forward to re-implementing some existing projects for comparison.
- snthpy 3y agoI would love to hear what your experience is. We've been using Pynecone for a bit and are coming up against some problems. For example trying to write a wrapper for AG Grid there is no way to pass a custom class attribute so you can't style the output with a theme.
- robopsychology 3y agoI found it very difficult to do things like rich text boxes for a ChatGPT clone I was writing aimed at being child friendly. Ended up giving up when it became a bit spaghetti-ish and after the documentation stopped being useful beyond hello world apps.
- anotherpaulg 3y agoI also built a chatgpt UI that was focused on early readers and kids. Feel free to clone and modify if you like. https://github.com/paul-gauthier/easy-chat https://github.com/paul-gauthier/easy-chat
- picklelo 3y agoCofounder of Pynecone here - thanks for the feedback. We’re prioritizing improving our docs and example apps in the upcoming weeks and will have a ChatGPT clone example. Definitely want to improve the onboarding experience and showcase these more complex use cases.
- bjornasm 3y agoCongratulations with the release of this very exciting framework! Can't wait to try it out.
- darkteflon 3y agoThat’s awesome - it looks like a really interesting project. Would you be able to address the specific criticism raised by parent, on rich text boxes? Is this a case of a documentation shortfall, or something more fundamental?
- deleted 3y ago[deleted]
- picklelo 3y agoWe want to support any UI feature that you can build with React/NextJS. We will expand our core to include components like rich text inputs but we also have a way to wrap any React library so you're not locked into the components we provide: https://pynecone.io/docs/advanced-guide/wrapping-react https://pynecone.io/docs/advanced-guide/wrapping-react
- ewuhic 3y agoPlease, add examples of rich authn and authz flows with 2FA and email integration for account verification.
- anigbrowl 3y agoMy projects are simple dashboards for internal use so I prioritize ugly and functional over aesthetic. technical verdicts from someone with more UI experience/affinity would likely help a lot more than my opinion.
- emmanueloga_ 3y ago"state is just a class" brings up so many questions though. How do you serialize state if it is "just a class"? Serializing the state is useful for all sorts of things, including debugging, reloading, and saving and loading application state. Serializing state together with some code that operates on it may be doable but sounds either complicated or brittle.
- JPKab 3y agoSeveral years ago, I worked at an enterprise software company that partnered with plotly and we had to use Dash to build a Tableau-like drag and drop dashboard builder. Dash had some amazing ideas and architecture, but suffered from too little hardcore developers working on the repo. Pynecone looks a whole lot like it was heavily inspired by Dash, but re-architected with the lessons of Dash power users. I find the project incredibly impressive and well thought out. I cringe at transpilation into Next.js, but the target code is actually extremely clean and easy to follow/read/debug. Kudos to the team.
- riedel 3y agoHow accessible is the output (WCAG, Code 508)? Or how easy is it to make it accessible? I could not find any hints on the website.
- swyx 3y agofor a second i read this as Pinecone, that 700m vector database
- nextworddev 3y agoSeems like a more ambitious Streamlit
- contravariant 3y agoIf that means you don't hit a brick wall when you try to go slightly beyond what it is capable of then I'm all for it.
- tymonPartyLate 3y agoIt's a beautiful project and close to the Holy grail of fullstack software development (a single framework for building modern Web apps). But, be advised that it's not production ready and quite unstable yet. this week my deploy script was broken because version 0.1.26 was un-released. Which broke my docker file build with pinned dependencies. The file upload component was changed a few times so my UI with file uploads silently stopped working. I had some issues when state binding input components. Which lead to the backspace key no longer working inside a text box. The websocket state updates can make the ui feel sluggish. Despite all that, I love this framework and will continue tinkering with it. It hope it can grow to maturity before people lose interest!
- nine_k 3y agoFor a full-stack framework I'd take something Typescript-based now, because TS has better static typing than Python currently (with all due respect to mypy), and the async story of JS is much easier than that of Python. And also the JIT. But it's interesting to see that Python is able to advance so much in this direction; I hope it will continue.
- ktbwrestler 3y agoThis looks awesome! Has anyone made a personal portfolio site/ blog with this yet? Considering jumping from Jekyll: https://jeffreylikeswebsites.com https://jeffreylikeswebsites.com
- thunky 3y agoI followed the link to try the increment/decrement example/demo from the landing page (https://pynecone.io/docs/getting-started/introduction https://pynecone.io/docs/getting-started/introduction). There is probably almost a full one second delay between the time I click the "increment" button and the updated count being rendered. Not seeing any network requests so I can't imagine why it would be so laggy.
- tymonPartyLate 3y agoClicking sends a websocket message to the backend. Which then responds with a state update message which updates the frontend react components. rhe round trip would probably take the same time with rest APIs, but you would have the ability to add some loading indicators or hints, because you'd have full control over client side rendering. You don't have that when using pynecone. It's a tradeof
- thunky 3y agoAh thanks, I see that now under the State -> Overview docs page: All user state is stored on the server. Behind the scenes, events are sent as API calls to update the state on the server. The state delta is then sent to the frontend, which updates the UI to reflect the new state.
- slmjkdbtl 3y agoSo it doesn't really have any client side interactivity? Thought it does from the example and wondering what magic they pulled to achieve that, they really should write this in big text up front cuz it's a pretty big factor when considering this software.
- picklelo 3y agoYeah we’re only hosting on a single region at the moment so there can be latency depending on your location. We’re working on using edge computing to speed this up.
- pedrosbmartins 3y ago
- dennisy 3y agoI love the idea of this! However whenever I see such good abstraction I always worry that when my project gets big and complicated there will be things which are not possible to do, and at that point switching will be super expensive.
- nine_k 3y agoDo you have the same feeling when e.g. starting a project using React? Why?
- dragonwriter 3y agoTBF, since this is itself an abstraction layer over React (well, NextJS), it is strictly a greater concern for this than React.
- worik 3y agoDon't. Just do not do this Python has a place in scripting Because you can, does not mean you should, build full applications with it It is a colossal waste of resources. It leads to genuine problems as it gets bigger that you will only find when you have considerable sunk costs. This is a terrible idea, it was a terrible idea in 1995 when people did this with Perl, it is a terrible idea now Use Python for what it is good at, not for what it is dreadful at
- mixmastamyk 3y agoThis is "premature optimization," IMHO. No, get the idea working first. Talk to customers... pivot... repeat. After finding a fit and portions are too slow look into Cython or offload to services in golang, etc. This looks like a great productivity booster.
- siva7 3y agoPeople also said similar things when Node.js crossed backed then the boundaries of our imagination. Nonetheless i agree that it can lead to genuine problems once it gets complex enough.
- worik 3y agoNode.js is very bad It amplifies all the bad desicions ever made in software Because you can does not mean you should,
- slmjkdbtl 3y agoFor this software if you change to any language it will still use the same architecture and technology, setup a http server and generate HTML and some client JS code to run on browser, just syntax difference or maybe performance. Curious what exactly is the part you think Python is dreadful at that this software contains? You can definitely say there are better performance language but I'm curious about if other factors.
- worik 3y ago> Curious what exactly is the part you think Python is dreadful at • A large memory foot print ▪ Inefficient execution That's two out of the top of my head I have been badly burnt by Mailman3, pure Python, pretty front end, 2G needed to install it. That cost me real money. The difference between a cheap, and a very cheap, VPS
- atakan 3y agosounds impossible to scale. but nice ui though
- slmjkdbtl 3y agoFrom what I read each action is a websocket roundtrip, yikes!
- mellosouls 3y agoRecent previous discussions include: https://news.ycombinator.com/item?id=33922754 https://news.ycombinator.com/item?id=33922754 https://news.ycombinator.com/item?id=35136827 https://news.ycombinator.com/item?id=35136827
- mixmastamyk 3y agoHow does this compare with Anvil, besides being newer? Anvil was shown off here a few years back: https://anvil.works/ https://anvil.works/ https://news.ycombinator.com/item?id=15584124 https://news.ycombinator.com/item?id=15584124
- deleted 3y ago[deleted]
- solarkraft 3y agoIt's not bad if your server isn't far away and you can compromise a bit on UX. A great tool if you need to quickly whip up a UI for some Python code (with more control than those machine learning-focused frameworks give you). Sadly it's apparently incompatible with SQLAlchemy 2.0, so I can't use it.
- picklelo 3y agoThanks for pointing out, we will update our sqlalchemy dependency to the newest version
- abraxas 3y agoI played with it and subsequently turned my back on it in favor of alpine.js and some vanilla JavaScript to handle client state with Flask on the back end. The reason I gave up on Pynecone is that these things transpile to other already high abstraction frameworks like React. This is all good and well until something goes wrong and you now have more layers to troubleshoot. Another huge downside to this approach is that now I have to deal with two sets of build and deployment tools: python and node. And given that I have few fond memories of the node tool set from previous project, I refuse to incur this complexity unless it's absolutely unavoidable. If someone actually built something like Pynecone that targeted html/dom/js directly instead of wrapping node/react/next I would be the first to hop on the bandwagon. Because the API is very good but the way that sausage is made ain't pretty.
- meredydd 3y ago> something like Pynecone that targeted html/dom/js directly instead of wrapping node/react/next This might not be what you were imagining, but I think this js more or less what we built at https://anvil.works https://anvil.works (I'm a founder). Anvil's UI toolkit is built "straight on the DOM", and it's shaped like Python objects rather than going via some other React-y abstraction. This is possible because we expose the difference between client and server code - even though they're both in Python (transpiled as necessary), and you can make mostly-transparent function calls from one to the other. Contrast Pynecone, where the UI is "puppeteered" from the back end over a websocket, so every update is a round-trip. And of course, because you're writing in-browser code, the HTML/JS interop is pretty straightforward (in fact, you can import JS objects right into Python code). There are downsides to our approach, of course - the developer needs to understand the difference between code in the browser and on the server, which can be a hurdle, and it's really neat that Pynecone apps can be a single Python file - but you don't have to round-trip every UI update to the server, and we've seen people have scaled up to some pretty big apps with Anvil!
- apetuskey 3y agoAgree a little different approaches, we found many developers wanted to stick with a 100% code approach and avoid the constraints of using an online drag and drop builder like retool/anvil etc. Instead opting to stick a traditional code tech stack that provides benefits like easier version control with ui and reviews with larger teams. Where as with a low code tool you are now forced to develop on the ui platform and locked in by the vendor. We have also had some users build some fairly large Pynecone apps including our whole website built in our own framework.
- dimator 3y agoNot to be confused with https://www.pinecone.io/ https://www.pinecone.io/ the vector database, which is also trending.
- bhargav 3y agoLooking at some of the examples in the docs [1]. Seems very odd that the mixin class they provided essentially lets you use bounded/instance variables and methods as class attributes and class method. Nevertheless, this seems very promising and I'm happy someone spent time on this 1: https://pynecone.io/docs/state/overview https://pynecone.io/docs/state/overview
- alberth 3y agoIs the “pure Python” comment a jab at Mojo? https://news.ycombinator.com/item?id=35790367 https://news.ycombinator.com/item?id=35790367
- apetuskey 3y agoNo definitely not really love what they are doing. It was a comment that its a framework where you just write python for everything
- fnordpiglet 3y agoI find it odd the front page has pinecone.io and pynecone.io
- yallpendantools 3y agoAwesome! Now that I've seen this framework, it tempts me though... I have this personal side project which in the wee days of me career I wrote in CherryPy; I love Python and have been exploring frameworks. I didn't really get a lot written in it because eventually I realized the project is frontend-heavy and I was never in the mood to write the JS for it. Recently I had the need for this side project again so I thought, why not rewrite it using a framework that would avoid me having to deal with the madness that is the Node.js ecosystem? For one reason or another I ended up with Vaadin. I've nothing against Java. If it works, it works. I got over the initial bump that is Spring and I got a "core" backend running, with tests too. My grievance with it is the usual Java fault of needing to write a lot of boilerplate just to shoehorn my app into the framework's philosophy. (Man, part of my initial consideration was even the tooling, editor, autocomplete, and all that, because damn me if I try Spring without these modern conveniences!) And this...this is all the things that attracted me to Vaadin---but in Python! I am so tempted to rewrite again. My experience and your documentation should make this a two hour job, right? Right? ("Haha, I'm in danger," my side project chuckles like Ralph Wiggum, staring blankly at https://www.commitstrip.com/en/2014/11/25/west-side-project-story/ https://www.commitstrip.com/en/2014/11/25/west-side-project-...)
- mithrilskeleton 3y agobut... how does it work?
- gragundier 3y agoDAMMIT WHERE WERE U 3-4 years ago?!
- yla92 3y agoLooks awesome! Is there a document to learn more about how it works really work under the hood ? I took a look at the source code but have yet to dive deep yet.
- charles_f 3y ago> Now everyone can work across the full-stack. > > With Pynecone every engineer can work across the whole stack allowing for a more efficient and productive workflow. I assume what is meant is that having a single language is allowing people who know Python to work "full stack". I don't believe in that argument 1. JS has brought you that since Node. 2. You can transpile Python to JS, the fact that it's the same language is only a marginal gain. Certainly you'll skip the few quirks of JS, but front end dev is arguably another paradigm from back-end, using the same language is not the biggest hurdle to learning front end dev. 3. This is proposing to learn a specific and niche framework that will probably not used in your next project or job, rather than spending similar time learning the proper, mainstream tools of front-end.
- PixyMisa 3y agoOn the other hand, everything about Node is bad.
- iamflimflam1 3y agoNot to be confused with pinecone - the vector database guys who just raised $100m
- kmarc 3y agoJust a heads up, on mobile Firefox (Android) I opened the increment/decrement example and after pressing any of the buttons there is a 500ms very long lag. I suppose this is not expected Edit: nevermind, its expected in slow connection due to a client-erver round-trip
- anonymous344 3y agoi never undestood how python can make .exe and other os supported binaries with gui? I tried one (forgot the name) and it looked like shit. Nothing like what you can get with vue+bootstarp or quasar + electron
- BiteCode_dev 3y agoWhile I applaud the attempt, stating it's "performant" is misleading, as any calculation that could happen client side means a call to the network with Pynecone. You can see it in their demo: https://pynecone.io/docs/getting-started/introduction https://pynecone.io/docs/getting-started/introduction The counter increment should be instantaneous, but instead, it goes through websocket, calls a python function on the server, and comes back. In which case the difference between this and django+htmx is not huge: mostly you get widgets in pure Python, and websocket is not experimental. Not sure it's worth giving up the whole django and htmx community to get locked in their widget set. I'm not saying this to hit on the project, I do think pycone is a cool idea and it's nice to see people trying to make web dev more accessible. But I want people to know what they are signing for.
- gjvc 3y agohttps://pynecone.io/docs/advanced-guide/telemetry https://pynecone.io/docs/advanced-guide/telemetry