onenote — Python bindings
pip install onenote-converter (the distribution is onenote-converter, the module is onenote).
Python API over the same Rust parser the onenote2md CLI uses. Nothing is
re-implemented here: a .one section, a .onetoc2 notebook and a .onepkg
package are parsed by the crate in the parent directory.
Install
Requires Rust (stable) only when building.
# development: build and install into the active virtualenv
python -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --release # or: maturin build --release + pip install target/wheels/*.whl
# a wheel for distribution (abi3: one wheel for CPython ≥ 3.8)
maturin build --release # → target/wheels/onenote-<ver>-cp38-abi3-<platform>.whl
pip install target/wheels/onenote-*.whl
API
import onenote
section = onenote.read_section("Section.one") # path or bytes
section.page_count # int
page = section.pages[0]
page.title, page.level, page.created, page.modified # ISO-8601 UTC strings
page.authors # list[str]
page.images # list[Image]
section.markdown(front_matter=True) # str, pictures as bare names
section.images() # list[Image] with .filename/.data
stats = section.write("out/Section.md", "out/img", front_matter=True)
stats.pages, stats.assets, stats.failures
Image.data is bytes. Names are unique and deduplicated per section and are
the same names markdown() links to, so the in-memory flow is safe:
md = section.markdown()
for image in section.images():
Path(image.filename).write_bytes(image.data) # every delivered `` resolves
Page.images uses the same names, filtered to the pictures that page references.
Links are percent-encoded; Image.filename is the raw name.
Some links have no payload in the file — OneNote web clippings and external
caches reference a picture without embedding it. Those are listed by
section.missing_images() (raw names), so callers can tell "delivered" from
"referenced only": links ⊆ {i.filename for i in section.images()} ∪ set(section.missing_images()).
notebook = onenote.read_notebook("Open Notebook.onetoc2")
notebook.name, notebook.toc
notebook.sections # [NotebookSection(name, path)]
notebook.groups # [Notebook] for section groups
notebook.errors # entries whose file/folder is missing
notebook.all_sections() # every section, depth first
stats = notebook.write("out/notebook", front_matter=True)
# out/notebook/<Section>.md + <Section>_assets/, one index.md per level
The tree reflects what conversion does: a folder with its own .onetoc2 is a
group even when the parent index does not list it, and .onetoc2 dotfiles (the
OneNote Recycle Bin sentinel) are ignored.
package = onenote.read_package("Open Notebook.onepkg")
package.entries # file names inside the cabinet
package.sections() # parse every .one entry
package.extract_to("dir") # write the entries and return their paths
stats = package.write("out/package", front_matter=True)
Package.write follows the CLI: when the cabinet carries a table of contents it
converts a notebook tree, otherwise each section on its own. MSZIP and stored
(no compression) folders are supported; Quantum/LZX raise ValueError.
Errors
Malformed files raise ValueError with the parser's message; unreadable paths
raise OSError. write never raises for a missing picture link — it reports the
paths in stats.failures and still writes the Markdown.
Tests
pip install -r requirements-dev.txt # maturin, pytest, twine
python -m pytest tests -q
The fixtures come from ../tests/fixtures plus tests/data/notebook, a small
notebook tree (a table of contents, a group and a nested group). The package
tests build their cabinet in Python, independently of the Rust reader.
Limitations
Same as the CLI: [MS-ONESTORE] revision stores are fully read, [MS-FSSHTTPB]
package stores are marked experimental, encrypted sections are reported but not
decrypted, and cabinet folders compressed with Quantum or LZX are rejected.
Metadata
Release files for onenote-converter 0.1.2
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_converter-0.1.2.tar.gz | 2.4 MB | With provenance | Details for onenote_converter-0.1.2.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| onenote_converter-0.1.2-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for onenote_converter-0.1.2-cp39-abi3-win_amd64.whl |
| onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| onenote_converter-0.1.2-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details for onenote_converter-0.1.2-cp39-abi3-macosx_11_0_arm64.whl |
| onenote_converter-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details for onenote_converter-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl |
Total release size: 5.0 MB
Release files / onenote_converter-0.1.2.tar.gz
| Download URL | onenote_converter-0.1.2.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d36055c724355c921bff8edfbf7f000d5facc51607b005c6f5435c99f9a92c9
|
|
BLAKE2b-256 checksum How to use checksums |
548f8d1b3c37b1c73949e87b7b40a0735dbf9967004952d33fd7b8ae2a53ce19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / onenote_converter-0.1.2-cp39-abi3-win_amd64.whl
| Download URL | onenote_converter-0.1.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 428.6 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
58d0c342ee1b163899364ea1b9aa16da44d764af09bba09e9a65ac19196acfbb
|
|
BLAKE2b-256 checksum How to use checksums |
e554592cf7f5d88d28d367b275bda64d0cf271d9d556972963e140db732ad9f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 569.4 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
649495bf31378641242a3e851ad24d6bce7759394607cb15056fddee4a547a5d
|
|
BLAKE2b-256 checksum How to use checksums |
1975f9f34f805c06a6b5247d66101652dd1dc1b373a3de961b87e2d1de2000d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | onenote_converter-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 554.9 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
70a63e49be0d42587bdc4d9133d3eed602280c2f0eaf59154106ae99bbb41b02
|
|
BLAKE2b-256 checksum How to use checksums |
66a52fa897381f9cfe26255274a8409cca2f50026078e97b2788be953c358864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / onenote_converter-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | onenote_converter-0.1.2-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 508.7 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9fa13850e944c7e29ef2620f3ea42fed42f0f6974bb361a269d9326b3a5ac1ac
|
|
BLAKE2b-256 checksum How to use checksums |
433cb996afd77d371017a63b624ad2bb94c61978110cbfa9cf76d52f9aef0dc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logRelease files / onenote_converter-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | onenote_converter-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 525.7 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a049e49a30dbf231770a1a6ba7a9f2ac702df8baa537136be5c7a30f2fa39a91
|
|
BLAKE2b-256 checksum How to use checksums |
46dbaec007f2039d22f574feae98c0f291cfc9a3ce3df421bcdc53e710ea8490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 27, 2026.
Transparency logSecurity for onenote-converter 0.1.2
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
All 6 files in this release have been uploaded with provenance metadata.
Attestation for onenote_converter-0.1.2.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 Oct 27, 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.