Live data from Hacker News

Show HN: Mesop – Open-source Python UI framework

google.github.io

1–10 of 56 posts

Show HN: Mesop – Open-source Python UI framework

#1
I’m excited to share about Mesop - a new, open-source Python UI framework that enables Python developers to quickly build delightful web apps in a scalable way.

A small team of us at Google have been developing Mesop as an unofficial 20% project for the past few months. A wide range of research and product teams at Google have been using it to rapidly build internal apps and we’ve gotten a lot of positive feedback internally so now we’re looking to get feedback from the open-source community.

We think that Mesop provides a unique approach to building web UIs in Python - making it both easy to get started and also flexible enough to build customized UIs for a wide range of use cases. You can learn more about why we built Mesop here: https://google.github.io/mesop/blog/2024/05/13/why-mesop/

To look at some example Mesop apps, check out our demo gallery: https://google.github.io/mesop/demo/. Also, the demo gallery itself is built with Mesop: https://github.com/google/mesop/blob/main/demo/main.py which demonstrates the type of flexibility you have in building apps with Mesop.

A couple of us will be on here answering questions. Let us know what you think!

Show HN: Mesop – Open-source Python UI framework
google.github.io

Re: Show HN: Mesop – Open-source Python UI framework

#2
This is appealing to me as a Python backend dev-- but if I end up building something cool for my own personal use, and I want to deploy it so others can use it-- is that a thing for this? I don't see any kind of documentation for deploying it, but that could just be on me. I realize this is touted as a demo-friendly / internal tool so that just might not be aligned for this type of thing.

Re: Show HN: Mesop – Open-source Python UI framework

#3

This is appealing to me as a Python backend dev-- but if I end up building something cool for my own personal use, and I want to deploy it so others can use it-- is that a thing for this? I don't see any kind of documentation for deploying it, but that could just be on me. I realize this is touted as a demo-friendly / internal tool so that just might not be aligned for this type of thing.

Yeah, you can definitely deploy it to share with others. Check out our deployment guide (https://google.github.io/mesop/guides/deployment/) which shows you how to deploy Mesop apps to Google Cloud Run, but you should be able to deploy it on pretty much any service that takes a container.

For example, the demo gallery (https://google.github.io/mesop/demo/) itself is a Mesop app which is hosted on Cloud Run

Re: Show HN: Mesop – Open-source Python UI framework

#4
post #3

This is appealing to me as a Python backend dev-- but if I end up building something cool for my own personal use, and I want to deploy it so others can use it-- is that a thing for this? I don't see any kind of documentation for deploying it, but that could just be on me. I realize this is touted as a demo-friendly / internal tool so that just might not be aligned for this type of thing.

Yeah, you can definitely deploy it to share with others. Check out our deployment guide ( https://google.github.io/mesop/guides/deployment/ ) which shows you how to deploy Mesop apps to Google Cloud Run, but you should be able to deploy it on pretty much any service that takes a container. For example, the demo gallery ( https://google.github.io/mesop/demo/ ) itself is a Mesop app which is hosted on Cloud Run

Thanks! I somehow completely missed the deployment section.

Re: Show HN: Mesop – Open-source Python UI framework

#6
post #5

Thank you! This looks very interesting and promising. I had issues running it locally on my Mac with pandas problems. But I switched to collab and it run well there. I guess you would use "requests" to get and post data to the backend ?

Could you share the error you're getting locally?

Re: calling backend, yeah you can use requests or anything else (e.g API client libs, talk to DB directly). The beauty is that you're just writing regular python code

Re: Show HN: Mesop – Open-source Python UI framework

#7
post #6
post #5

Thank you! This looks very interesting and promising. I had issues running it locally on my Mac with pandas problems. But I switched to collab and it run well there. I guess you would use "requests" to get and post data to the backend ?

Could you share the error you're getting locally? Re: calling backend, yeah you can use requests or anything else (e.g API client libs, talk to DB directly). The beauty is that you're just writing regular python code

The error is: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import)

This happens only on the second interaction.

Re: Show HN: Mesop – Open-source Python UI framework

#8
post #6
post #5

Thank you! This looks very interesting and promising. I had issues running it locally on my Mac with pandas problems. But I switched to collab and it run well there. I guess you would use "requests" to get and post data to the backend ?

Could you share the error you're getting locally? Re: calling backend, yeah you can use requests or anything else (e.g API client libs, talk to DB directly). The beauty is that you're just writing regular python code

So If I make a request from the python code, is the request executed in the browser ? or on the server ? Is the UI layer executing in the browser and use proxy rpc from the server ?

Re: Show HN: Mesop – Open-source Python UI framework

#9
post #8
post #6

Earlier quoted context omitted.

Could you share the error you're getting locally? Re: calling backend, yeah you can use requests or anything else (e.g API client libs, talk to DB directly). The beauty is that you're just writing regular python code

So If I make a request from the python code, is the request executed in the browser ? or on the server ? Is the UI layer executing in the browser and use proxy rpc from the server ?

All the python code, including requests are executed on the server

Take a look at https://google.github.io/mesop/internal/architecture/ for an explainer on how the client-server interaction works and let me know if you have any questions!

Re: Show HN: Mesop – Open-source Python UI framework

#10
post #7
post #6

Earlier quoted context omitted.

Could you share the error you're getting locally? Re: calling backend, yeah you can use requests or anything else (e.g API client libs, talk to DB directly). The beauty is that you're just writing regular python code

The error is: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import) This happens only on the second interaction.

OK thanks. I've filed an issue here: https://github.com/google/mesop/issues/345 if you could share with us a repro (the Mesop code you're running) on the issue, that would be helpful in debugging this.

If you take a look at the "table" example on the demo gallery: https://google.github.io/mesop/demo/ it shows how to use Pandas w/ Mesop, so I'm not sure what's going on.

Post reply on HN