NinoDui / notexport

Python CLI tool for exporting Apple Book Highlights&Notes to .csv file and Anki card.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notexport (note + export)

Python tool to

  1. Export highlights and Notes from Apple Books to local CSV/Excel files
  2. Fetch the word meaning
  3. Create Anki Cards
  4. Export reading notes to Notion (under development)

Usage

Dump Notes from Apple Books

python main.py \
    --title "<keywords in book title>" \
    --output <your desired output path, data/booktitile_timestamp/notes.csv as default>
    --after <time filter in format YYYYMMDD-hhmmss, e.g., 20230903-175824, default to None, indicating 19700101-000000>
    --before <time filter in format YYYYMMDD-hhmmss, e.g., 20230903-175824, default to None, indicating NOW>
    --join_vocabulary <If you would like to join word meaning from local vocabularies, set it to True, otherwise leave it as default (False)>

Convert MDD/MDX dictionary files to local SQLite Database

python notexport/vocabulary/local_vocabulary.py \
    --mdx_path <mdx_file_path> \
    --sqlite_db_path <output db file location, when set to None, db will saved aside mdx file under the same folder>

This function relies on mdict-query, which is added as a submodule under notexport/ext, remember to:

git submodule init && git submodule update

Create Anki Cards

python notexport/anki/transform.py \
    --data_path <your file location, which must contain columns ['Title', 'CleanedWord', 'meaning', 'BroaderText']. It's highly suggested to be generated by main.py with join_vocabulary>

Milestone

  • Dump Highlights & Notes to a local file, supporting filters by 1) book name 2) time range
  • Query local vocabulary mdx/sqlite database for word meaning.
  • Create Anki Cards with contents in HTML format

TODO

  • Notion Export
  • SQL Template via ninja
  • Docker Image and portable usage support
  • Lemmatization with better tokenize/pos_tag/lemmatize methods
  • Splitazation of words/sentences.

Acknowledge

  1. angela-zhao and her project apple-books-annotations-exporter
  2. mmjang and his project mdict-query

About

Python CLI tool for exporting Apple Book Highlights&Notes to .csv file and Anki card.

License:MIT License


Languages

Language:Python 100.0%