back
▲ 399 points

Launch HN: Neptyne (YC W23) – A programmable spreadsheet that runs Python

by dosinga·3y ago·211 comments·view on hn ↗
Hi HN! We are Douwe and Jack, founders of https://neptyne.com. Neptyne is a programmable spreadsheet that runs Python. It’s like Google Sheets, but for software engineers and data scientists. If you have three minutes, go to https://neptyne.com/neptyne/tutorial and it gives you a taste.

The world runs on spreadsheets, and for good reason: they are a universal data canvas. But building on top of and around the spreadsheet is clumsy: limiting scripting environments, APIs and file formats get in the way of making the spreadsheet a part of a broader application. Excel workbooks become monolithic and unmaintainable. Google Sheets data become static and stale.

Both Excel and Google Sheets offer some level of programmability but we have yet to find any user who liked the experience. It’s harder than it should be, using programming languages that are more limited than you expect. With Excel you've either got VBA or an extension like pyxll to deal with. With Google Sheets, your options are AppsScript or the REST API. These tools are mediocre but the need for programmable spreadsheets is such that people use them anyway.

With Neptyne, the spreadsheet itself runs in the Python runtime, so you can write to it or read from it like an in-memory data structure, because that's exactly what it is.

Neptyne primarily solves problems that exist at the boundaries of what other spreadsheet tools can do. We make Python a first-class citizen of spreadsheet-land, meaning you don't need a clumsy integration or extension to make your code work with spreadsheets. You can use standard off-the-shelf Python libraries to build on top of an Excel-like spreadsheet environment to build collaborative applications. You mix Excel style cell addresses (A1, C3) and ranges (B2:B20) with Python code (e.g. `A1 = "foo" if B2 > 0 else "bar"`, or `for num in B2:B20:`).

Before starting Neptyne we worked at Sidewalk Labs, where we built models in Python that would typically be shared or used via spreadsheets on an interdisciplinary team. The final step of many pipelines was "write a .csv with the results", which was a great way to share data but only in one direction. What we really needed was a way for users to interact with our Python models through a spreadsheet: tune inputs, see results, make quick aggregations. After making some version of this work with the Google Sheets API, we knew this could be better. What we wanted was basically a Jupyter notebook embedded in our spreadsheet, that could give us the full power of Python while keeping the accessibility of a spreadsheet. We built a proof of concept, found some interest in it, and formed Neptyne.

Neptyne differs from lots of modern takes on the spreadsheet tool in that we really wanted to preserve the "data canvas" nature of a true spreadsheet. While there is value in making spreadsheets more like SQL databases with column-based types and formulas, Neptyne gives you the freedom to structure your spreadsheet as you would with Sheets or Excel. Mix and match data types, table dimensions, graphs, charts, and buttons as freely as you might with those tools.

Neptyne behaves exactly like a spreadsheet but is secretly an alternative frontend to a Jupyter Notebook that has an embedded spreadsheet engine. Because it runs a Jupyter kernel, we support anything you can run in a Jupyter notebook, including all the expected visualization packages (matplotlib, plotly, etc.). This is not merely scripting using Python—you can use any (stateful) Python framework to get serious work done.

Things users have built with Neptyne so far include a Twitter bot, a private spaceflight schedule optimizer, and a CRM that pulls from several different data sources.

Neptyne's basic tier is free to use. As we add more capabilities to the product, certain features will be introduced at paid tiers. For individuals building interesting stuff to be shared with the community it will always be free. For teams that need private documents, sharing and custom images, we will charge a team fee.

Here’s a link to some videos: https://www.youtube.com/@neptynehq that show how Neptyne works. If you really want to get a sense of the product, the best way is try out our three minute tutorial: https://neptyne.com/neptyne/tutorial.

We’d love to hear about things you’ve built in spreadsheets and what new things might be possible with a native Python integration! Fire away!

211 comments
Hey, this is awesome! As someone who primarily codes in Python, I love that it's first class with a REPL! Nothing frustrates me more then when I have to figure out Javascript for scripting in Google Sheets.

I ran through your demo and I have some feedback:

- Tab completion in the REPL would be great.

- When I change code in the editor, it doesn't update the cell where that code is used until I click on the cell, click away, and click back.

- When I ran the append function, it worked, but if I look at the array in the cell, it's unchanged. If I click on the cell and hit enter, it wipes out the append. I'm honestly not sure what the right behavior here is, I can see use cases on both sides. But initially I did expect the cell with the array to update with the new array.

- When I tried to do autocomplete on the capitals, it failed silently. I assume the API failed to fetch the capitals? It worked on the second try (but took a while).

- When I add a column into the sheet, it breaks all the code that has cell references. I'd expect the code with cell references to get updated unless my references are $F$4 for example, just like in the sheet itself.

Overall though this is a great start!

Thanks, this is excellent feedback:

* The REPL is supposed to do autocomplete where it makes sense. If you enter A1. it should show you a list of things you can do there. That always feels better than asking for it explicitly. Let me know if that doesn't work.

* Yeah, code changes don't rerun the affected cells. It is something we've debated, and maybe we should? It feels like it could also cause unexpected things to happen. Hmm. Maybe we should though.

* This is tricky. Spilling from a function, doesn't fill the cells and then append does. Open for suggestions on how to make this better.

* We call the OpenAI API - they don't always answer these days :-(

* That's a good point. We should fix that!

This is cool, but I think it might be missing what the big problems with spreadsheets are.

I was complaining just today because I pasted some records into Excel and it decided to treat 933349234275230104 as a number (it's a hash), convert it to scientific notation (which I NEVER want), and lose precision. Yet there is no way to globally disable scientific notation. Plus it's kind of insane that "formatting" changes data in the first place.

I frequently paste timestamps into Sheets or Excel and it just ruins everything. If split-to-text puts the date part in one column and the time part in another, I can't put them back together with a simple string concatenation, because again "formatting" turned my date text into Excel's weird internal number. This is legacy behavior that Excel has to keep for backward compatibility, but I don't want it, and I wish I could turn it off.

Sometimes I'll try to scatter-plot 5 series against a timestamp, and Excel will decide all 6 columns are series, even though a scatter plot with no X-axis makes zero sense. Even when it does work, Excel seems stubbornly uninterested in understanding how dates/times work, and I can't do simple things like tell it to have an X-axis tick every day/week/month.

If you are building a spreadsheet in 2023, the #1 goal should be leaving behind all the baggage, even if it has to be behind a toggle. Listen to what people find frustrating about Excel (tip: it's gonna be dates) and fix that.

If you can do that, then yeah, Python! Woo! Neat! But that's not going to be the main draw, because it's not a solution to the main problems that spreadsheets have.

I don’t know if you’re aware of it, but if you want unaltered text content in an Excel cell, prefix it with a single quote ('). This “escapes” the value so that it isn’t interpreted as any other data type.
While we didn't set out to solve those problems in Neptyne, using actual data types in a spreadsheet does solve this sort of problems. Of course we have to be a little compatible, so our dates do come with the 1900 is a leap year bug that pre-dates excel. But they also have a .to_datetime() if you want to be more sophisticated. We have great plots out of the box, but if we want to go deeper, you can use whatever plotly or pydeck construct gets you exactly what you want.
This can be resolved by changing the cells' format from General to Text. This makes the cells display the text exactly as entered. Select the relevant cells -> right click on them -> Format Cells... -> Text -> Ok
It's already solved in Google Sheets
Founder of AlphaSheets here -- we built this back in 2015 and developed it for 3 years. We built Python, R, SQL and full excel formula/hotkey/format/conditional formatting/ribbon compatibility. It was a long slog!

I wish you good luck and all the best. It's a tough field but a big market. And I still think the potential is there.

I noticed that AlphaSheets is no longer in operation - couldn't find the website. What happened?
> You mix Excel style cell addresses (A1, C3) and ranges (B2:B20)

Well, that's unfortunate for "power" users - I'd imagine they'd want what excel calls r1c1 mode:

https://learn.microsoft.com/en-us/office/troubleshoot/excel/...

One of the many valuable lessons from Joel Spolsky "You suck at Excel" (around 8:30 mark): https://youtu.be/0nbkaYsR94c

You can access stuff in a different way of course. Each sheet is also a python object, so you can just go Sheet1[20, 20] or Sheet1[10:20] if you like that way better
The concept of Python-based spreadsheets was explored by Resolver One[1], a defunct proprietary desktop app that was discontinued ~10 years ago[2].

It seems a web version of the app has been published in open-source[3] but that too has been EOL.

[1] https://web.archive.org/web/20120211201410/http://www.resolv... [2] https://www.resolversystems.com [3] https://github.com/pythonanywhere/dirigible-spreadsheet

I remember this from the book IronPython in Action. The book teaches IronPython (Python for .Net) by having you build a spreadsheet application. The author worked on Resolver One.
(cofounder of Neptyne here)

Thanks for mentioning this! I came across Resolve One recently in another HN thread. Were you a user yourself? What did you think of it?

I've seen a bunch of companies do this. The problem is always that it isn't Excel. This means usually things like XLWings, Excel-DNA, etc. are actually more useful.
I think Gnumeric has supported this for years.

https://help.gnome.org/users/gnumeric/stable/sect-extending-...

I recall doing a noise model of a transimpedance amp in Gnumeric where I called out to Python/Numpy to do integration of 1/f noise based on parameters from a datasheet. That was at least 10 years ago. What's the difference between this Gnumeric feature and Neptyne?

This sounds like a really good idea - combining spreadsheet convenience with being able to do programmatic manipulations with python can be really value for people who are using spreadsheets to do modeling (e.g financial). I think (especially based on some other comments) a big challenge will be just getting people out of their current bubble. If you do financial modeling, you might be entrenched in excel, and if you so data science in python, you might never dream of using spreadsheets.

My unsolicited advice (that's probably on your radar anyway) would be to try and get a management consulting firm on board with this. The flexibility this has would be well used there, and you've got lots of people who are engineers stuck using spreadsheets that would be on board with trying something like this.

Very cool! I constantly struggle trying to do things in spreadsheets that are easy in Python. But I/O makes it annoying to write one-off scripts for a 30 second op. This would solve that pain point!

I would love a Google Sheets integration, since that's where I already live with most of my CSV/Sheets data + it would seamlessly fit into my workflow. If this was a Chrome extension I would have installed it today.

As is, I don't see myself using another spreadsheet app.

FYI There is PyXLL which is an add on for Microsoft excel that gives this functionality without a need to log into any thing.
Wow this is cool! I created a similar thing over the summer but never took it anywhere because I felt GSheets would just add Python.

https://github.com/ricklamers/gridstudio

Rooting for you guys

Very Excited.

I'm likely very close to the ideal user. I don't program for work but make CSV-consuming tools from Python here and there to work on giant exports of data when they get outside of Excel's built-in magic.

Most recently the exact task was to consume a Zoom user export, filter with RegEx, and transform the table for upload to Zoom as a CSV again, but with different fields. This would translate very well to Neptyne if it supported 70k rows.

This is really cool. There was another recent post about something similar: https://news.ycombinator.com/item?id=34805132

One question/thought: what's your security like? Inevitably, people treat spreadsheets like databases for better or worse. That means they often contain lots of things that might be better stored elsewhere - sometimes PII, sometimes a proprietary formula, set of factors as inputs to a process, etc.

So, I think many spreadsheet-heavy businesses will avoid something that doesn't obviously sit inside the fortress of security they've approved. Of course, someone can just accidentally email a spreadsheet to the wrong person or store it somewhere with no security. It happens all the time, I'm under no illusion.

Point is: I would be more likely to give it a shot given a base level of confidence about the security of storing anything in these sheets.

Interested to hear your take!

I remembered Alphasheets was acquired by Google a couple of years ago for doing similar thing (they programmed in Haskell which is really cool) https://medium.com/bloated-mvp/alphasheets-mvp-review-ec328e...
Very cool. I've done plenty of work supporting non-technical users who primarily interact with spreadsheets. This would definitely make my life easier.

Is it going to be cloud-only, or are you planning on making a desktop app? If it's cloud-only, you can grab some (hopefully many) Google Sheets users, but most Excel users will probably pass.

Why choose this over pySpread?

https://pyspread.gitlab.io

LibreOffice Calc combined with python's pandas and numpy modules meet all needs I have for spreadsheets, with matplotlib and seaborn for visualization. The Ipython shell is the optimal IDE for this approach IMO. My desktop reference is:

"Python for Data Analysis 2nd ed" (Wes McKinney, 2018)

On the surface this seems like an impossible market to penetrate. But you must know this. What is the deeper insight that one who thinks this is missing?
I believe Google Sheets supports programmability using Javascript these days. Is your product fundamentally different? Thanks and all the best.
I like the idea: I was actually looking at an open source tool that does something similar: combine spreadsheets with python.

I do have a question: Similar tools tend to fall down after the code grows to a certain size. Modularity, unit tests, etc. become more useful at this point. I'm wondering if Neptyne will (or does?) support these sorts of features?

Edit: Here's a link to the developer docs: https://docs.google.com/document/d/1zLOXBoy-nf05SU3d5sZ7lDDg...

This looks fantastic, and sadly completely misses the mark on a huge industry that uses excel every day: investment management, hedge funds, etc. Why? Because this is yet another cloud only solution with no self hosting possibility.

These firms are very-very rich and would pay good money, but a very small %-age will be willing to give you their data. It doesn't matter how many certifications you quote about data treatment, we will simply not trust you with our data, full stop.

You say pyxll is a mediocre tool, but IMO they understand how this industry works.

Really sad, because the tool itself looks fantastic...

Looking for something like this exactly. Is it possible to install on site? No way my company would want prop data on a cloud.
Looks cool, but the get started --> skip signup to try now --> empty tyne flow is broken. When I click "empty tyne", it just reloads the page and blocks you with "empty tyne" again and again.

Also, I'm curious if it supports live collaborative editing like google sheets/docs/etc do?

I know python, don't really know VBA. This will open up a new world for me. Excited to try it out.
Good opportunity to highlight Google "Apps Script" which is one of the most powerful but unknown tools in the web: https://developers.google.com/apps-script/guides/sheets

Includes easy fetching: https://developers.google.com/apps-script/reference/url-fetc...

I suppose python could be better for this use case but javascript seems to work fine. And it's all built righ in to Google Sheets.

> Drag the corner from F7 to F9 to compute the total cost for each unit.

I do that.

> Server connection error: failed to connect to server

I get that the system is overloaded, but if every small action requires a network, and I can't use it with intermittent network let alone offline, I'm not too thrilled.

Back in 2012, I used Data Nitro / Iron Spread. It enabled running Python on spreadsheets.

My problem back then with the tool was that it sat between chairs. It was impossible to run Python entirely, as it only ran a subset of libraries and did not have a package manager, and it required thinking about cells, as is the case with Excel formulas.

As a result, I could only use some of my Python codebase and not collaborate with other Excel users who were not Python experts. We ended up reverting to Excel formulas or VBA.

I'm curious about who is the target user for Neptyne. Is it Python developers and data scientists who want to do some spreadsheet work?

Very cool idea. Since it is based on Jupyter Notebook, can I self host this for my needs?
Interesting! Congrats on the launch.

I tried it out, and just first feedback:

- I often use the "Home" and "End" key to go the start/end of the line when I'm editing a cell. It scrolls to start/end of the whole spreadsheet, however. Since I'm not a spreadsheet user, I'm not sure if that's expected.

- The handlers like "on_dropdown_change" should receive an argument for the cell it's coming from, so you can e.g. change the cell that's next to it. Or how else is this supposed to be done?

It's quite cool :-) I suppose one problem could be integration with existing Google Sheets / Excel sheets?

Very cool! Does it allow real-time multi-person editing? (It's not very clear from the landing page.)

If so - how do you handle multiple people editing the code area at the same time?

Would be a killer feature if this was robust!

I can't understand how this will improve the work. I see the value of having python instead of sheets formulas for python developers, but developers would work on totally different toolsets (like Jupyter notebook, as you mentioned), or something like StreamIt or https://gradio.app/

This would be useless for spreadsheet users (those who use sheet formulas) as they have to learn python.

I'm not in the target audience, so I might be completely wrong about the use cases.

This is impressive. It seems like you really understand the requirements of the audience that uses spreadsheets AND data centric Python! The REPL, in particular, is a nice touch.

My biggest concern with a tool like this is that the power-iest power users who would love it tend to work at big enterprises where they're locked into productivity suite bundles with Microsoft or Google. Additionally, if you get traction, Google and Microsoft would be very likely to clone your features for Sheets and Excel.

This looks very useful, I can see this being used in schools and universities for a plethora of studies.

However I am European in EU, and while your Privacy policy is eminently readable, I don't think it can be used in EU school settings as you do not specify who your 3rd party service providers ar, what their privacy policys are or where data is hosted (thank you for making it human non lawyer readable).

Schools/Universities in EU are not allowed to use services that are not hosted in EU.

Im not sure if you use Google Analytics but please know that the legality of using GA in EU has been questioned in both Netherlands and Ireland. I'm not up to speed on the proceedings but I believe the Netherlands found it to be in violation of GDPR since the data was not stored or processed in EU. EDIT: Add Austria, France, Italy, Denmark, and now Finland to the list...

I may be wrong, but most people that know python have already understood there's better ways to code than spreadsheets. Also, at least where I live, not even Google could undermine Excel's dominance.

PS: I'm convinced I was indeed wrong after reading replies, because I didn't consider the interaction of coders with no coders, and this tool may indeed be useful. Nevertheless I maintain these cultural changes are very hard, and wish the company good luck!

Traditionally the business is the source of spreadsheets (data comes from the biz side of the equation). The data analyst then has to make sense of the data.

So to convince a BA to input their data on Neptyne because the DA might need to python script it at some point is maybe premature optimization.

That's an uphill battle... But I definitely see it a good case for me personally as someone who both originates data (nothing fancy) and needs to process it further...

Will definitely check it out!

Congrats ! Looks really cool !

I always had this rule of thumb, "the better a programmer is at spreadsheets, the worse programmer he is" :D Mostly cause I suck so much at spreadsheets. I always think to myself, dammit I'm a career programmer how come I can't do a double-column lookup across two sheets with my eyes closed :(

Anywhoo congrats again, now can we make it work with something nice like Clojure or Lisp :P ?

There have been a least half a dozen companies and countless FOSS projects attempting to do the exact same thing. What makes this special?
I yet to understand a reason for cell to be addressed by A1 or C1R1 style. put it in a table, give a column a name. Numbers got it right.
This looks really cool.

When I try to get started on https://neptyne.com/neptyne/_new though, I get a HTTP 403 for the POST to https://neptyne.com/api/tyne_new and it brings be back to the selection screen.

can it handle a million rows? 10M?

believe it or not this is my biggest problem with Sheets, and while Excel does better it's still capped at 1M