How to Access/Download OneNote notebook with Python?

Charles Clayton picture Charles Clayton · Jan 5, 2016 · Viewed 12.3k times · Source

How do I access a OneNote notebook using Python? Is there a way to export it to a pdf or other file programmatically? The notes are taken by hand, so I unfortunately can't just parse it for text.

I've found this article from 2011, but the links are dead and I imagine it would be outdated anyway. I've also found this GitHub but I don't see how to implement it to do what I want.

Alternatively, is there another language I could use?

Answer

jayongg picture jayongg · Jan 6, 2016

If your notebooks are stored in OneDrive or Office 365, you can use the OneNote APIs to access them. Information about the APIs are on http://dev.onenote.com/.

For sample code, check out https://github.com/onenotedev/. There is sample code (in C# and other languages) that allows you to access pages in Notebooks.