Python Forum
how to use pyexcel to read ods
Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use pyexcel to read ods
#1
Hello everyone

I have posted this on the previous forum but didn't resolve this issue. I  have big ods file ( HERE )

and i am trying to read only some parts of the file for example first row but whatever i tried pyexcel tries to load whole sheet in memory before it read anything from the file and this takes a lot of time. Here is my code if anyone has idea how to read single row please let me know

from pyexcel_ods import get_data


part_data=get_data("arhiv.ods",start_row=4,row_limits=1)
print(json.dumps(part_data))

here is the code :

from pyexcel_ods import get_data

part_data=get_data("arhiv.ods",start_row=4,row_limits=1)
print(json.dumps(part_data))
Reply
#2
When copy code web,mark all code and push 2-3 times on Remove Formatting button.
Or copy it out from a  text editor.
Reply
#3
i have copied it from ide don't know what went wrong with formating :)
Reply
#4
Dos it really read all into memory when using read partial data?
Reply
#5
for less then 30sec this code eated more then 4GB of ram :) do you have any proposals on how to read single row from this file ?
Reply
#6
There's always pandas see https://realpython.com/blog/python/worki...in-pandas/
Reply
#7
please try pyexcel-odsr instead, which does read partial ods file.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020