Convert Google NotebookLM flashcards and quizzes to Anki decks
Project description
notebooklm-to-anki
Convert Google NotebookLM flashcards and quizzes into Anki decks (.apkg) you can import and study with spaced repetition.
License: MIT
What it does
Google NotebookLM can generate flashcards and quizzes from your study materials. This tool takes those exports (JSON files) and converts them into .apkg files that Anki can import -- so you get the best of both worlds: AI-generated questions + spaced repetition.
flowchart LR
A[NotebookLM] -->|export or nlm-py| B[JSON]
B -->|nlm2anki| C[.apkg]
C -->|File > Import| D[Anki]
Quick Start
pip install notebooklm-to-anki
# Convert a JSON file you already have
nlm2anki convert flashcards.json
That's it. Open Anki, go to File > Import, select the generated .apkg file, and start studying.
Want to pull directly from NotebookLM?
pip install 'notebooklm-to-anki[nlm]'
notebooklm login
nlm2anki flashcards --all
Features
- Converts flashcards (front/back) and quizzes (multiple choice with rationale)
- 3 built-in card themes: dark (Catppuccin Mocha), light, and minimal
- Optional category grouping via YAML config
- Works with local JSON files or directly with NotebookLM (via notebooklm-py)
- Quiz cards show all options (A-Z) with correct/incorrect rationale on the back
Usage
Convert local files
Flashcards:
nlm2anki convert flashcards.json
Quizzes:
nlm2anki convert quiz.json
The output .apkg file is saved in the current directory.
Download from NotebookLM
Download flashcards from all your notebooks:
nlm2anki flashcards --all
Download from a specific notebook:
nlm2anki flashcards --notebook "Biology 101"
Choose a theme
nlm2anki convert flashcards.json --theme dark # Catppuccin Mocha (default)
nlm2anki convert flashcards.json --theme light # Clean light background
nlm2anki convert flashcards.json --theme minimal # No styling, just text
Organize by category
Create a categories.yaml file to group cards into sub-decks:
Git Basics:
- commit
- branch
- merge
SQL:
- SELECT
- JOIN
- WHERE
Then pass it with --categories:
nlm2anki convert flashcards.json --categories categories.yaml
Cards whose content matches a keyword will be placed in the corresponding sub-deck.
JSON Formats
Flashcards
[
{
"front": "What is spaced repetition?",
"back": "A study technique where you review material at increasing intervals to improve long-term retention."
}
]
Quizzes
[
{
"question": "Which planet is closest to the Sun?",
"options": [
{"letter": "A", "text": "Venus"},
{"letter": "B", "text": "Mercury"},
{"letter": "C", "text": "Earth"}
],
"answer": "B",
"rationale": "Mercury orbits at an average distance of 57.9 million km from the Sun, making it the closest planet."
}
]
Installation
Basic -- convert local JSON files only:
pip install notebooklm-to-anki
With NotebookLM integration -- download flashcards directly:
pip install 'notebooklm-to-anki[nlm]'
For development:
pip install 'notebooklm-to-anki[dev]'
Requires Python 3.10+.
How it works
Under the hood, nlm2anki uses genanki to generate .apkg files.
- Flashcards become Anki Basic notes (front/back).
- Quizzes become cards with the question + options A-Z on the front, and the correct answer + rationale on the back.
- Plain text from NotebookLM is enriched with HTML formatting (inline code, SQL keywords, CLI commands) so cards look good in Anki.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
git clone https://github.com/difrancesco/notebooklm-to-anki.git
cd notebooklm-to-anki
pip install -e '.[dev]'
pytest
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notebooklm_to_anki-0.1.0.tar.gz.
File metadata
- Download URL: notebooklm_to_anki-0.1.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1c2ed5633acd4102b2713ab79833d77cd06ac4ddc0ffc90a14f0fd3fff36339
|
|
| MD5 |
56dd8641620c9fd20790127af3527bad
|
|
| BLAKE2b-256 |
32b3015418513ab74143c65a4ba2bb3fd13fbcee6d71746886253514f454c37e
|
File details
Details for the file notebooklm_to_anki-0.1.0-py3-none-any.whl.
File metadata
- Download URL: notebooklm_to_anki-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9c2c1e6f1f6efcf20add0b7ba9c9eab31ad7560ea7935dd36914cde27ff5a53
|
|
| MD5 |
495d7bc8ea3526456bb49ac4e6d5a3f2
|
|
| BLAKE2b-256 |
7572a78872ff883c2d8f62e92c8452584cd854882ad3173191718637a1e915b2
|