Skip to content

how read metadata only? #140

Answered by ofajardo
il-giza asked this question in Q&A
Jul 19, 2021 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

The C library behind pyreadstat (Readstat) reads all the bytes from the file and puts them in RAM. This is unavoidable. Once it is in RAM, I use the API to parse those bytes and first get the metadata, and then parse and extract the data. When you use metadataonly I stop after parsing the metadata, avoid parsing the numerical data, this saves time and some extra memory while creating the python objects for the data, but this is as good as we can get. So, there is no way to read only a fraction of the bytes and from there parse the metadata. Does that answer the question?

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ofajardo
Comment options

You must be logged in to vote
1 reply
@ofajardo
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants