pythonanywhere / dirigible-spreadsheet

Dirigible, the Pythonic spreadsheet in your browser
MIT License
213 stars 50 forks source link

Export formulae #3

Open leenaars opened 5 years ago

leenaars commented 5 years ago

Dear folks,

first thanks very much for making this open source after you closed down Revolver!

I've always been really curious how it worked, and have finally come round to building it. Really cool! I do have one question: is it possible to export the data while retaining simple formulae? I currently only see a csv export, but that removes any cell references and replaces it with the calculated values, right? So you cannot backup and then roundtrip a document that way. Is there another option to save data - or even get it from the backend of the server?

leenaars commented 5 years ago

Actually, having an restructuredText (or similar) output would already very much suit my use cases...

hjwp commented 5 years ago

I guess you just set yourself a coding challenge!

leenaars commented 5 years ago

So can you tell me where and how the data is stored? Perhaps python-lpod can be used to turn into an OpenDocument spreadsheet ...

hjwp commented 5 years ago

I'm not sure I remember to be honest! Internally the data structure is a dict of objects which have a .value and a .formula object.

I can't remember whether we store it in a database, or on disk as json, or what... probably in the database, as json, I would guess. if you want to try and extract directly from the db, maybe check the django models and see if you can find what column it's in?

If you wanted to make an actual button and a UI for this, you could have a look at the way the csv exporter works (search the codebase for "csv") and try and make a copy of that, and modify it?