Giter VIP home page Giter VIP logo

onenote-dump's Introduction

onenote-dump

A utility for converting a Microsoft OneNote notebook to markdown.

The output is targeted for compatibility with Notable, which means:

  • Markdown has metadata at the beginning
  • Links to attachments use @attachment syntax
  • Links to other notes use @note syntax

It retrieves OneNote data through the Microsoft graph API, so the notebook needs to be synchronized with the cloud.

Installation

The script requires Python 3.6+.

You'll probably want a virtual environment:

python -m venv .venv

Then activate the virtual environment, and install the dependencies. For example:

.venv\Scripts\activate.bat
pip install -r requirements.txt

If you have poetry, you can use that instead:

poetry install

Running

python onenote_dump/main.py <notebook> <output directory>

The <notebook> parameter is the display name of the notebook. For example:

python onenote_dump/main.py "Software Development Notes" C:\Temp\dump

NOTE: If you are using poetry, you can use the onenote-dump binary that is created with poetry install instead of python onenote_dump/main.py.

For full usage details:

python onenote_dump/main.py --help

When run, the script will launch a browser window so that you can authorize the script to access your OneNote data. Subsequent runs won't require this, so long as the authorization token is good (about an hour). If you want to force re-authentication, you can pass the "--new-session" param.

The output directory and parents will be created if needed.

If your notebook is large, there is a good chance you'll hit the request rate limit on Microsoft's API, which will cause the script to wait for a few minutes and try again. You may wish to kill the program (Ctrl+C) and use the --start-page option some time later, or the --section option to select a subset of a notebook.

If you're happy with the output, you can copy it to your Notable notes directory.

onenote-dump's People

Contributors

genericmoniker avatar pre-commit-ci[bot] avatar jingmatrix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.