How to pass a binary file data to python #2164
-
I have a sqlite db in web worker. I want to export the database to binary file data, then pass the data to python.After doing this, I can use Python to analyze database data. Can you tell me how to pass data to python?Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you are able to extract the DB as Uint8Array you can create a Blob then a URL that will serve that blob and you can fetch it via pyscript fetch as That being said, it's not clear what is your current stack so any extra detail might help. |
Beta Was this translation helpful? Give feedback.
If you are able to extract the DB as Uint8Array you can create a Blob then a URL that will serve that blob and you can fetch it via pyscript fetch as
array_buffer()
which will give you a memoryview of that data ... you can then pass it to sqlite (if that's available in pyodide) as db to use and the rest is regular SQL.That being said, it's not clear what is your current stack so any extra detail might help.