Aspose.Note FOSS for Python is a 100% free, MIT-licensed library that lets you read Microsoft OneNote (.one) files entirely from Python, with no Microsoft Office, no COM automation, and no proprietary runtime required. It exposes a clean public API (aspose.note.*) modeled on the familiar Aspose.Note for .NET interface, backed by a built-in MS-ONE/OneStore binary parser written in pure Python.
Install from PyPI with pip install aspose-note (or pip install "aspose-note[pdf]" to enable PDF export). Requires Python 3.10 or later.
The library is suitable for document automation scripts, content indexing pipelines, archival tools, and any server-side workflow that needs to consume OneNote content without a Microsoft Office dependency.
Document.Document → Page → Outline → OutlineElement → RichText / Image / Table / AttachedFile.RichText.Text or inspect TextRun segments for bold, italic, font, color, and hyperlink metadata.Table → TableRow → TableCell hierarchies with column widths and border visibility.NoteTag metadata (shape, label, color, completion state) on text, image, and table nodes..one files.Document to PDF using Document.Save(path, SaveFormat.Pdf).PdfSaveOptions.Image nodes to retrieve raw bytes, filename, dimensions, and alt text.AttachedFile nodes to save embedded file attachments to disk..one files from a binary stream (e.g., io.BytesIO) without writing to disk.Aspose.Note FOSS installs with a single pip install aspose-note command. The base package has no optional dependencies; PDF export requires ReportLab, installed via pip install "aspose-note[pdf]".
The API is modeled on the familiar Aspose.Note for .NET interface: Document, Page, Outline, RichText, Image, Table, AttachedFile. The library is MIT-licensed, open-source, and accepts bug reports and contributions on GitHub.
Install with pip, then pass a file path to Document() to parse the OneNote binary format. GetChildNodes(RichText) performs a deep recursive search and returns every text node in the document, which is useful for full-text indexing or migration pipelines.
pip install aspose-note
from aspose.note import Document, RichText
doc = Document("notebook.one")
print(f"Pages: {doc.Count()}")
# Extract all text across the entire document
texts = [rt.Text for rt in doc.GetChildNodes(RichText) if rt.Text]
for text in texts:
print(text)
PDF export requires the optional ReportLab dependency. Install it with pip install "aspose-note[pdf]". The same Document object can also be iterated for Image nodes to extract and save all embedded images to disk in one pass.
from aspose.note import Document, SaveFormat, Image
import pathlib
doc = Document("notebook.one")
# Export the document to PDF (requires aspose-note[pdf])
doc.Save("output.pdf", SaveFormat.Pdf)
# Save all embedded images to disk
out_dir = pathlib.Path("images")
out_dir.mkdir(exist_ok=True)
for i, img in enumerate(doc.GetChildNodes(Image)):
name = img.FileName or f"image_{i}.bin"
(out_dir / name).write_bytes(img.Bytes)
It is a free, MIT-licensed Python library for reading Microsoft OneNote (.one) files without requiring Microsoft Office, COM automation, or any proprietary runtime.
OneNote 2010, OneNote Online, and OneNote 2007 format variants. Any valid .one section file can be loaded.
Run pip install aspose-note for the base library, or pip install "aspose-note[pdf]" to include the optional ReportLab dependency for PDF export.
Yes. Call Document.Save(path, SaveFormat.Pdf). PDF export requires the optional ReportLab dependency installed via the [pdf] extra.
Yes. The Document class accepts a binary stream (e.g., io.BytesIO or an HTTP response body) so you can process files without writing to disk.
Python 3.10 or later is required.
No. The current edition is read-only. It can open and parse any valid .one section file, but writing back to the OneNote binary format is not supported.
No. Loading a password-protected .one file raises an IncorrectPasswordException. Encrypted documents are not supported in the current edition.
The library is MIT-licensed and hosted on GitHub. Bug reports and pull requests are welcome.