onenote-tool
A Python library and CLI for parsing and converting Microsoft OneNote
.onepkg (notebook export) and .one (section) files — including
best-effort content recovery for password-protected sections, which
Microsoft's own tooling doesn't expose.
This is not an official Microsoft project, and it is lossy by design: OneNote's binary format ([MS-ONESTORE]) is large, partly undocumented, and this tool reads what it can, reports what it can't, and never claims perfect fidelity. See Documentation.md for exactly what's currently supported.
What it's for
- Pulling text, images, tables, hyperlinks, ink/drawings, and embedded
files out of a
.onepkgexport into a neutral, semantic HTML-per-block format your own code can render however it likes. - Recovering as much as possible from a password-protected section, given the password — OneNote's own export/print tools generally refuse to touch protected content at all.
- A quick command-line tool for poking at a notebook's structure while
developing against it (
onenote-tool inspect), without writing a script each time.
It is explicitly not trying to be a pixel-perfect OneNote renderer —
the output is deliberately generic (see "The blocks format" in
Documentation.md) so that a consuming application does
its own layout/styling, rather than this library making that decision for
everyone.
Install
pip install onenote-tool # library only
pip install onenote-tool[cli] # + the `onenote-tool` command-line tool
(Not yet published to PyPI — see docs/knowledge/known-limitations.md
for current status. For now, install from a local clone: pip install -e ".[cli,dev]".)
Platform note: unpacking a .onepkg (a CAB archive) uses Windows'
expand.exe when present, otherwise falls back to the cabextract CLI
(install via apt/brew/dnf) on Linux/macOS. Run onenote-tool doctor
to check which one it found. See
docs/knowledge/known-limitations.md.
Quick start — CLI
onenote-tool convert MyNotebook.onepkg --dump-dir ./out
onenote-tool convert MyNotebook.onepkg --section-password "My Section"=hunter2
onenote-tool inspect SomeSection.one --password hunter2
onenote-tool doctor
Quick start — Python API
from onenote_tool import convert_onepkg
result = convert_onepkg("MyNotebook.onepkg", section_passwords={"My Section": "hunter2"})
print(result.notebook_name, result.page_count)
for section in result.sections:
print(section.name, section.password_status)
for page in section.pages:
print(" ", page.title, [b["kind"] for b in page.blocks])
See Documentation.md for the full API/CLI reference,
the blocks format contract, how passwords are handled, and the
progress-reporting flow for a caller that wants to show live conversion
progress (e.g. a web backend importing a large notebook).
Learning how this works
If you're picking up development on this project, start with docs/knowledge/ — it has everything that was reverse engineered to make this possible (the file format, the encryption scheme, and a chronological log of what was tried and what actually worked), so you don't have to re-derive it.
License
MIT — see LICENSE.
Metadata
Release files for onenote-tool 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onenote_tool-0.1.0.tar.gz | 86.5 kB | With provenance | Details for onenote_tool-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onenote_tool-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for onenote_tool-0.1.0-py3-none-any.whl |
Total release size: 155.9 kB
Release files / onenote_tool-0.1.0.tar.gz
| Download URL | onenote_tool-0.1.0.tar.gz |
|---|---|
| Size | 86.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa6f935d98de988d58c98ceb1111f894bc7218731ae89749a8a4b3ca43abf3ae
|
|
BLAKE2b-256 checksum How to use checksums |
4ed15597ecbe3ef175af81e9acae7bdcbcc1107f2ac10c63a3ed0a7d91e96d5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / onenote_tool-0.1.0-py3-none-any.whl
| Download URL | onenote_tool-0.1.0-py3-none-any.whl |
|---|---|
| Size | 69.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbf46a91ef0ca4aedde2bcce48199cb1e5b21bb66cf3a8d6853d0580c0d5f19d
|
|
BLAKE2b-256 checksum How to use checksums |
9f34d5b197dab7709e03ec10d78a46f1c36f674f30388e0398e10c27e4d35e4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logSecurity for onenote-tool 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for onenote_tool-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.