I am trying to read .one file(OneNote files) and want to write its content into a text file, but didn't find a single way to do it using Python. Please help me with this.
Is there anyway to read .one(OneNote files) using Python script?
Asked Answered
Possible duplicate of #34622971 –
Apfel
@JorgeLavín am able to fetch OneNote into my local but not able to read its content.By looking at API didn't find a way to read. Please suggest any possible solution. –
Staid
one note contains not just text, they have many other formatted contents. so do you really only need the text in it? –
Grams
This isn't Python, but for other internet voyagers trying to escape Microsoft's iron grip this PowerShell script is pure magic.
https://passbe.com/2019/bulk-export-onenote-2013-2016-pages-as-html/
Try to get the content of your notes calling:
./me/onenote/pages/1-1c13bcbae2fdd747a95b3e5386caddf1!1-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/content?includeIDs=true&includeInkML=true&preAuthenticated=true
It will give you text/html, which you can parse with https://pypi.org/project/lxml/
I didn't find a good way to decode .one file. But I find another way to workaround it.
- Install OneNote 2016 and sync the contents.
- Install the Evernote legacy version
- Import data from OneNote to Evernote. (There's a button on GUI).
- Export notes to html from Evernote.
- Then you can do whatever you want. Yeah!
© 2022 - 2024 — McMap. All rights reserved.