Ollienor
Posts: 5
Joined: Tue Feb 10, 2015 9:39 pm

Continuous data stream to ODS

Thu Feb 19, 2015 3:43 pm

I'm looking for a way to output from a python program to a spreadsheet.

The data I want to output is the reading from a tachometer, which is a data stream which updates every 1s. So every 1 second I want the RPM value to be written to the next row of the same column in a spreadsheet. So ideally I want to specify column 1 and keep adding data in a list to that column as the program creates a value for RPM from the GPIO pin I'm using.

Does that make sense?

I can find plenty of examples of outputting to ODS when the entire dataset is known, so just copying data stored within the script essentially to an ODS file. I don't know what values or how many there will be I just need them to be logged in a spreadsheet.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Continuous data stream to ODS

Thu Feb 19, 2015 4:36 pm

https://github.com/mmulqueen/odswriter

Keep the file open as long as you want and write new values each second.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Continuous data stream to ODS

Thu Feb 19, 2015 5:07 pm

have you looked at http://pythonhosted.org//ezodf/docmanag ... g-document ? That looks to do what you're after.

But it might get very slow to keep opening a spreadsheet to add a single value if it's likely to get very big. Could you write it to a text file (csv) which would be quick and easy. You can import or read from a csv on your spreadsheet.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Ollienor
Posts: 5
Joined: Tue Feb 10, 2015 9:39 pm

Re: Continuous data stream to ODS

Sat Mar 14, 2015 11:54 am

Thanks for the replies, I went with the csv option, did exactly what I wanted. Cheeers!

Return to “Python”