---
Product: Aspose.Note
Platform: python
Page Type: index
Canonical URL: https://products.aspose.org/note/python/
---

# Aspose.Note FOSS for Python

Read, traverse, and export Microsoft OneNote (.one) files from Python — free and open-source, no Microsoft Office required.

Aspose.Note FOSS for Python is a 100% free, MIT-licensed library for reading Microsoft OneNote .one files. Provides text extraction, image export, table parsing, attachment saving, and PDF export. Install with pip.

## Open-Source Python Library for OneNote Files

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 (add the `[pdf]` extra 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. For the enterprise product family, see [Aspose.Note — Enterprise Product Family](https://products.aspose.com/note/).

## Read and Traverse OneNote Documents

- **Load .one files:** Open any OneNote section from a file path or binary stream via `Document`.
- **Full DOM traversal:** Navigate `Document → Page → Outline → OutlineElement → RichText / Image / Table / AttachedFile`.
- **Rich text extraction:** Read raw text via `RichText.Text` or inspect `TextRun` segments for bold, italic, font, color, and hyperlink metadata.
- **Table parsing:** Traverse `Table → TableRow → TableCell` hierarchies; read column widths via `TableColumn.Width`.
- **Tag inspection:** Read `NoteTag` metadata (shape, label, color, completion state) on text, image, and table nodes.

## Where Aspose.Note FOSS Can Be Used

- **Content indexing:** Extract and index all text from OneNote archives for search pipelines.
- **Document migration:** Export OneNote sections to PDF, plain text, or structured data.
- **Archival tools:** Save embedded images and attachments to disk from `.one` files.
- **CI/CD workflows:** Validate or process OneNote content inside Docker containers.
- **Knowledge-base pipelines:** Extract structured content from team OneNote notebooks.

## Export, Images, and Attachments

- **PDF export:** Save any loaded `Document` to PDF using `Document.Save(path, SaveFormat.Pdf)`. The FOSS edition uses a default rendering; advanced per-page PDF options are not available in this release.
- **Image export:** Iterate `Image` nodes to retrieve raw bytes (`Bytes`), filename (`FileName`), and dimensions (`OriginalWidth`, `OriginalHeight`).
- **Attachment saving:** Iterate `AttachedFile` nodes to save embedded file attachments to disk.
- **Stream-based loading:** Open `.one` files from a binary stream (e.g., `io.BytesIO`) without writing to disk.

## Developer Experience

Aspose.Note FOSS installs with a single pip command. The base package has no optional dependencies; PDF export requires ReportLab, added via the `[pdf]` extra.

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.

## Load a OneNote File and Extract All Text

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.

```bash
pip install aspose-note-foss
```

 ```python
from aspose.note import Document, RichText
doc = Document("notebook.one")
print(f"Pages: {len(list(doc))}")
# 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)
```

## Export to PDF and Save Attached Images

PDF export requires the optional ReportLab dependency, added via the `[pdf]` extra. The same `Document` object can also be iterated for `Image` nodes to extract and save all embedded images to disk in one pass.

 ```python
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)
```

## Frequently Asked Questions

### What is Aspose.Note FOSS for Python?

It is a free, MIT-licensed Python library for reading Microsoft OneNote (.one) files without requiring Microsoft Office, COM automation, or any proprietary runtime.

### Which OneNote format variants are supported?

OneNote 2010, OneNote Online, and OneNote 2007 format variants. Any valid `.one` section file can be loaded.

### How do I install it?

Install the base library from PyPI, or add the `[pdf]` extra to include the optional ReportLab dependency for PDF export.

### Can I export OneNote files to PDF?

Yes. Call `Document.Save(path, SaveFormat.Pdf)`. PDF export requires the optional ReportLab dependency installed via the `[pdf]` extra.

### Can I load .one files from a stream?

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.

### What Python version is required?

Python 3.10 or later is required.

### Can I write or modify a .one file?

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.

### Are encrypted OneNote documents supported?

No. Loading a password-protected `.one` file raises an `IncorrectPasswordException`. Encrypted documents are not supported in the current edition.

### Where can I find the source code?

The library is MIT-licensed and hosted on GitHub. Bug reports and pull requests are welcome.

## Support and Learning Resources

- [Documentation](https://docs.aspose.org/note/python/)
- [API References](https://reference.aspose.org/note/python/)
- [Free Support](https://forum.aspose.org/)
- [Contribution](https://contribution.aspose.org/)
- [Blog](https://blog.aspose.org/)
- [New Releases](https://releases.aspose.org/)