PySheets – Spreadsheet UI for Python
pysheets.app
pysheets.app
I like the idea. I'm not a commercial dev, but a so called "scientific" programmer, meaning that I use programming mainly as a problem solving tool. But once in a while I create little apps for my colleagues to use, many of whom don't program. But they can manage spreadsheets quite well.
I'm pretty committed to Python at this point, but deployment of an app is a headache, and I've explored a variety of solutions. I've written a couple of web apps using *flet*, and they run on pretty much every platform I've tested. This seems like a nice approach.
The thing I'd like to figure out is how to give a web app access to a user's files, though I appreciate why this should be difficult for security reasons.
Alternatively, you could create a form to "upload" a specific file, but instead of uploading it, read the bytes from the PySheet's cell function.
We implemented something like PySheets initially where the formula language was full Python. But we found the Python interpreter to be the bottleneck during (e.g.) large CSV imports, and the GIL prevented parallelizing evaluation. It was also harder for business users to adopt due to small syntactic differences between Python and the Excel formula language.
So we implemented the spreadsheet engine and formula language in Rust. We have a Python code window that allows you to write arbitrary Python functions. Those functions can be called as formulas from any spreadsheet cell. We seamlessly marshall Pandas dataframes from Python land to spreadsheet land and back. It gives you 90% of the benefits of pure Python without compromising on performance.
PySheets currently runs inside the browser, on top of WebAsm, and the limitations there are bigger than just Python's slowness. You have only 4G addressable memory, including the interpreter and libraries. Network bandwidth is also a limiting factor for client-side computation.
That said, PySheets can render a sheet based on a 50,000-row Excel sheet in 0.5s and needs about 20s to do a full end-to-end recompute run. There are limits to what you can do in the browser without using an external kernel that can run Polars on large datasets. But, I think most people will be fine with what PySheets can let them do.
Finally, as the author of PySheets I am honored that a "competitor" sees us as a threat. I am quite impressed by Rowzero myself. Nice work :-)
One really nice thing about your approach is it minimizes infrastructure cost. That positions you well for embedding use cases, like New York Times visualizations, that we struggle to do economically.
Best of luck!
I want to use such a thing to create internal dashboards similar to retool.
Lots of people use us for dashboards.
Live updating data is a pain I've messed around using javascript to force refresh html iframes on a timer. But I was never really satisfied with this. I've heard you can do things with websockets but that is starting to get too complicated for me (I'm not a programmer).
For static stuff one of the data scientists in my org pointed me to Streamlit (https://streamlit.io/) it's a python package I found very easy to use. Can easily combine SQL with CSV imports and display them all on one dashboard. Can use forms toggle butotns etc to control the display.
Is there some similar project but selfhosted? I would be uncomfortable with uploading health related data to external service.
Grist's closer to "what if Access had an interface that was more like Excel". Pysheets is more like "what if Python data structures had a GUI that looked like Excel".
To put it another way, I love Grist but _would not_ recommend people who are using spreadsheets to try to bring their spreadsheets into it. I also love pysheets and _would_ recommend it for that usage.
That said, only the data stored in the sheet itself is stored in PySheets. Most use cases will load data from another place, filter and convert it, and then render a result. Still, self-hosting would be an interesting use case.
https://buckaroo-data.readthedocs.io/en/latest/articles/rela...
I didn't know about visidata this is incredible. Thanks everyone for the informative post.
I think they are some of the same folks who later founded PythonAnywhere, which I had also tried.
I read recently somewhere that they were acquired by Anaconda.
But then I see "AI-driven", which I should note is the _third_ line of text on the web page. I assume it is an important feature for the author of the page.
I control-f, "ai-driven", it is only used one other time on the page:
"Perform easy AI-driven visualization with Matplotlib"
There is no further elaboration on the home page and I have been unable to find additional docs. (Someone please post a snarky RTFM response with a link to the manual, cuz like I said I am very interested in this. I did google "pysheets docs" which uhh linked to a python library with the same name...)
Last week, for the first time ever, I used noted "AI" ChatGPT to review a resume I had written. I wouldn't normally do this, but the company I was applying for heavily emphasized that they use chatgpt to generate code and review things.
Ever the skeptic, I decided to try it myself. I have to say I was impressed with the results. EXCEPT, ChatGPT, pointed out a grammar error in my resume which literally did not exist. Like the sentence it was critiquing in it's feedback was not found anywhere in my resume nor was there anything similar (from my perspective, I'm sure 1000 layers deep in it's network there was some similarity to something that had the error and wouldn't it be cool if we could effectively debug that).
ANYWAY, when I see ai-driven without elaboration in a spreadsheet program, I am very concerned that my data might be "hallucinated" and I would encourage the author to explain what exactly this means. Will my charts be correct 99% of the time but sometimes a hallucination? What's going on here? I would probably be signing up for the beta right now if I had any idea. Thanks.
(final snark: funny that one of the authors is named Kurt Vile, what are the odds https://www.youtube.com/watch?v=4uAXMl-Bfiw)
The AI is used to generate Python code, not to analyze or generate data in the sheet. I will clarify that on the landing page. Hopefully, that will inspire you to try it out.
This is a different Kurt Vile :-)
It's hardly a criticism of pysheets specifically, but I wish spreadsheets were more restrictive (I.e. force sheets into a table format) so that people could build out spreadsheets in an org without creating an unholy mess that needs to be picked apart and reversed engineered in something that isn't a spreadsheet.
I was hoping for spreadsheets I could integrate into Jupyter.
Just like CoPilot or Sourcegraph's Cody is used in VS Code, PySheets uses OpenAI to suggest the Python code to write when the sheet contains a Pandas data frame of a certain shape. The AI accelerates figuring out what APIs to call and when. I myself find Matplotlib and Pyplot highly confusing, and a coding assistant that writes my code in this niche, makes me a lot more productive. It is cool to say, "Take the dataframe in E13 and generate an orange bar graph for it," and see the code generated.
What I can't do (or don't know how to) is to have the data presented in an editable and interactive sheet inside Jupyter.
I've tried the widgets, and they're generally painful to use, or maintain the extensions required.
There is visidata for Python&Spreadsheets&On-Prem(&SQL) as a TUI.
visidata.org
EDIT: found it! LTK: https://github.com/pyscript/ltk