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.
Asked
Active
Viewed 4,019 times
11
-
Possible duplicate of https://stackoverflow.com/questions/34622471/how-to-access-download-onenote-notebook-with-python – Jorge Lavín Oct 15 '18 at 09:35
-
2@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. – Anshul Oct 15 '18 at 10:47
-
one note contains not just text, they have many other formatted contents. so do you really only need the text in it? – Lei Yang Jul 14 '21 at 01:37
3 Answers
1
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/

Jonathan
- 648
- 4
- 13
- 34
0
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/

Kfcaio
- 442
- 1
- 8
- 20
0
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!

Hanzhou Tang
- 351
- 2
- 6