LibrePythonista allows running IPython code in a LibreOffice spreadsheet
128 points
4 months ago
| 10 comments
| github.com
| HN
buovjaga
4 months ago
[-]
reply
mdaniel
4 months ago
[-]
I know this comment is a lot of words, and may feel critical, but I assure you I mean them in the spirit of "for your consideration" and want to start off by saying thank you for sharing such a cool toy with the world under a permissive license. Great job, and thank you!

I was trying to find out which version of python it offered, and while digging into that I found surprising references to win32 binaries in the pyproject <https://github.com/Amourspirit/python_libre_pythonista_ext/b...> although the extensions page says it's for all 3 major OSes.

Related to that permalink, please do consider creating a formal tag that represents the code that went into the 0.1.1 binary you linked to. It'll greatly help those trying to track down bugs if they don't have to $(git bisect) in order to find out which sha created the extension they're using

Kind of related to that, future you (and folks who clone your repo) are going to be sad if you keep putting the release artifacts in git, since it will make your repo grow without bound. If you want to make the .oxt available to folks outside of the libreoffice.org URL, that's another fine reason to create a tag since GitHub will cheerfully hold on to the .oxt with a permalink forever, but outside of your repo. It'll also motivate you, or a contributor, to create a GitHub Action showing how normal people could possibly build the release artifact for themselves

reply
buovjaga
4 months ago
[-]
Ok, can you report that to the developer: https://github.com/Amourspirit/python_libre_pythonista_ext/i...

I'm not affiliated with this project.

reply
2Gkashmiri
4 months ago
[-]
shouldn't this functionality be included in the base libreoffice itself? so... just asking, how much efforts would it take to integrate it fully into the code as opposed to an extension? that way more people would use this feature and more people would help improving the code.

good job. need more work done like yours in libreoffice.

reply
buovjaga
4 months ago
[-]
Yes, some LibreOffice developers commenting on this agree with you. We also have existing proposals like "Ship Python package manager (PIP) with LibreOffice internal Python" https://bugs.documentfoundation.org/show_bug.cgi?id=162786
reply
jordigh
4 months ago
[-]
If Python in a spreadsheet is what you want, you might like Grist:

https://www.getgrist.com/

Disclaimer: I work there. I'm trying to make it easier to self-host. Send me github issues or pull requests if you have ways of making it better. :)

reply
abdullahkhalids
4 months ago
[-]
I have been meaning to use Grist for an educational org I volunteer for - mainly to manage student data. We would definitely self-host, and it is great that there is already a Class Enrollment template. Your self-hosting docs [1] seem pretty straightforward. However,

* I am annoyed that the the app requires providing inputs through command line args or environment variables rather than a fixed config file that I can store in git. * Some directions on creating a service that starts the app on server restart etc would be good.

[1] https://support.getgrist.com/self-managed/

reply
jordigh
4 months ago
[-]
Thank you. I've been struggling with a good story for configuration. I'm not entirely satisfied either with using environment variables for everything.

Using Docker, you can just put your env-vars in a file and execute Docker with --env-file specifying where your configuration is, which is what I currently do, but perhaps a .env file would be more standard and comfortable.

reply
abdullahkhalids
4 months ago
[-]
Let me put it this way. Your app has wide possible usage, including a lot of casual usages, by relatively non-technical users. Like small businesses or clubs etc, as your templates show. Spreadsheets run the world, and grist is turbo spreadsheets.

If you want those people to use your software, you should make it as easy as possible to install it. Think of a tech-minded teenager helping their dad set up grist to track inventory for their corner store. How can you help them install the software in a couple of hours?

reply
slightwinder
4 months ago
[-]
Grist is not really a spreadsheet, it's a row-orientated database-system. Quite different in usage.
reply
jordigh
4 months ago
[-]
It is intended to replace spreadsheet use, and the database columnar restrictions are intentional.

Moreover, since it's using sqlite in the backend for the database, cells are allowed to hold the wrong type (and big, red warning colours light up when this happens). This is a sqlite characteristic. So while it mostly does enforce database-like behaviour, it also allows spreadsheet-like lax behaviour.

It really is a mixture of database and spreadsheet.

reply
guestbest
4 months ago
[-]
How does this compare to using something like visual foxpro?
reply
WillAdams
4 months ago
[-]
Why not just use pyspread?

https://pyspread.gitlab.io/

reply
jsyang00
4 months ago
[-]
because they want the sheet in LibreOffice?
reply
IgorPartola
4 months ago
[-]
This is off topic but I feel like Pythonista should have been called Parseltongue. Total missed opportunity.
reply
kkfx
4 months ago
[-]
Hum, I'm curious why then using a spreadsheet at all... Why not direct Python or R, since in essentially all cases are far simpler and better...
reply
2Gkashmiri
4 months ago
[-]
Second thing now, does this make livreoffice now compatible with excel Python embedded files ?
reply
buovjaga
4 months ago
[-]
Not until someone implements the handling of such in XLSX import. Excel needs a cloud connection to run Python and there are apparently some homegrown functions like xl(), so it probably would not be straightforward:

https://www.solvermax.com/blog/python-embedded-in-excel-firs...

reply
2Gkashmiri
4 months ago
[-]
Why in gods green earth would you want a cloud connection to run a Python script on your computer when you canr run python locally since day 1 of Python ?

So these files wont run if you are offline ?

reply
buovjaga
4 months ago
[-]
Maybe Microsoft thinks it's a good solution to security concerns, if the code is run in their sandbox.
reply
fn-mote
4 months ago
[-]
This project has the most incredible, strikingly artistic icon I have ever seen.

It’s worth a visit to their landing page just to see it.

I don’t need the functionality, but wow.

Edit: I really hope the art wasn’t made by an “AI”… but if it was they just passed my Turing test.

reply
BlackLotus89
4 months ago
[-]
It's AI. Have no background information you don't have I think I'm just good at spotting it.

Scales are intricate and seem correct yet the gears are irregular and often not gear shaped, assymetrical etc. Some things look nonsensical and functionless. The circle around has has imperfections and the resolution of the image is too low.

reply
WillAdams
4 months ago
[-]
Artists are all-too often terrible about drawing gears/mechanical things.

EDIT: That said, I agree it's likely AI --- the odd mis-matches of scale size, and the lack of interest in how the background elements interact are what I would view as signs of AI generation.

That said, I'd be curious about which tool was used to make the file, and what the prompt was --- I really wish that there was a way to embed that persistently in the underlying file so that it could then be revealed --- or, a regulation that all AI-generated images be uploaded to a central repository where, when image search reveals them, the specifics of their creation are made known.

reply
punnerud
4 months ago
[-]
Definitely AI, almost all of the gears does not work. A real artist already putting this much effort into it, would never make this mistake
reply
olejorgenb
4 months ago
[-]
> A real artist already putting this much effort into it, would never make this mistake

I'm not so sure that's true. See https://youtu.be/6JwEYamjXpA?t=321 Granted - most of the examples in Matt Parker's talk isn't exactly work of art, but I'm sure effort were put into them.

Edit: I agree the way the cogs don't work in the project's logo is of a different class, so maybe you have point.

reply
keyshapegeo99
4 months ago
[-]
The inconsistent teeth on the gears give it away. I'd wager a lot that it's AI generated
reply
rty32
4 months ago
[-]
I can't pinpoint what exactly it is, but the logo has this AI "vibe" that I see out of AI generated images in my own experiments.

And I can't agree it is incredibly artistic in any way. May be you should go to more art galleries or something.

reply
MrVandemar
4 months ago
[-]
Definitely AI. I have a weird visceral reaction to AI generated images and that triggered it.

(I put it down to distracting myself with an AI image generator while I was very, very unwell and now my brain equates the output of one with t'other).

reply
progfix
4 months ago
[-]
The design looks very much AI generated.
reply
morkalork
4 months ago
[-]
I feel like if you're asking how to shove Python into a spreadsheet app, you've made a mistake somewhere in your process and should reconsider everything.
reply
dang
4 months ago
[-]
"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something."

https://news.ycombinator.com/newsguidelines.html

reply
josenyc
4 months ago
[-]
Walk us through your hypothesis. People solve problems in various ways, and workflows can change. Having more options can be useful and lead to new solutions.
reply
add-sub-mul-div
4 months ago
[-]
Unfortunately, main character syndrome can't be cured with talk therapy.
reply
morkalork
4 months ago
[-]
Do you even know what that is or do you just parrot insults you've seen others use?
reply
SoftMachine
4 months ago
[-]
I feel like you've made a mistake somewhere in your process and should reconsider everything.
reply
mardifoufs
4 months ago
[-]
What do you mean? How is it worse than spreadsheet specific languages, like VBA or even in-cell formulas in say, Excel?
reply
kbrkbr
4 months ago
[-]
Microsoft offers Python for Excel for quite some time now [1]. Seems like a natural fit, when you are used to working in spreadsheets and want to add the low code machine learning capabilities that Python offers.

[1] https://www.microsoft.com/en-us/microsoft-365/python-in-exce...

reply
Qem
4 months ago
[-]
It doesn't run locally.
reply
anitil
4 months ago
[-]
I'm in the process of ripping gsheets out of some internal processes, and the pain they are causing me are immense, so I understand the sentiment of this.

However. If those sheets hadn't existed earlier on, I might not have a job at all because they business wouldn't have been able to easily/cheaply solve the problems that they did

reply
cadsax
4 months ago
[-]
Hi
reply