Generate flashcards from Obsidian notes using AI and sync them to Anki
Project description
ObsidianKi
Automated flashcard generation to Anki from your Obsidian vault.
Installation
# uv
uv tool install obsidianki
# uv (source)
uv tool install https://github.com/ccmdi/obsidianki.git
# pip
pip install obsidianki
# pip (source)
pip install https://github.com/ccmdi/obsidianki.git
Why?
Obsidian is a knowledge store. You write notes without the explicit intention of reviewing them later. The knowledge in Obsidian is unstructured (natural language), and forcing flashcard review into Obsidian via manual question/answer pairs is making it something it fundamentally isn't.
Anki, on the other hand, is an application exactly for purposeful review. Anki is inherently structured via "question/answer" flashcard format.
To get the best of both worlds, knowledge management in Obsidian and review scheduling in Anki, we need to translate the unstructured notes to structured flashcards. Bridging this gap is the main goal of ObsidianKi.
Setup
Run:
obsidianki
This will start the interactive setup. Here's what you'll need:
-
Obsidian access (pick one in setup):
- Obsidian CLI (Obsidian 1.12+): enable Command line interface in Settings → General and register the CLI.
- Local REST API: install the plugin and copy the API key from its settings.
-
AnkiConnect setup:
- Add-on code:
2055492159 - Keep Anki running
- Add-on code:
The interactive setup will guide you through model selection and configuration.
Usage
oki # Generate from random old notes
oki --notes "React" # Generate from specific note
oki --notes "frontend/*:3" # Sample 3 notes from folder
oki -q "What is X?" # Standalone query (no source note)
oki --notes "React" -q "hooks" # Targeted extraction from note
See the reference for all commands and options.
Index
-
Vector deduplication - best deduplication method
-
MCP server - for conversational use
-
Environment variables - optional
.envsettings for Obsidian -
Reference - cli usage
Configuration options
| Setting | Default | Description |
|---|---|---|
max_cards |
6 |
Maximum cards per session |
notes_to_sample |
3 |
Number of notes to process in default mode |
days_old |
30 |
Only process notes older than N days |
sampling_mode |
"weighted" |
"weighted" or "uniform" note selection |
card_type |
"custom" |
"basic" or "custom" Anki card type |
deck |
"Obsidian" |
Default Anki deck name |
approve_notes |
false |
Review each note before processing |
approve_cards |
false |
Review each card before adding to Anki |
deduplicate_via_history |
false |
Avoid duplicates using processing history |
deduplicate_via_deck |
false |
Avoid duplicates by checking existing deck cards |
use_deck_schema |
false |
Match existing card formatting in deck |
syntax_highlighting |
true |
Enable code syntax highlighting |
upfront_batching |
false |
Process notes in parallel (faster) |
batch_size_limit |
20 |
Max notes per batch |
batch_card_limit |
100 |
Max cards per batch |
density_bias_strength |
0.5 |
Bias strength against over-processed notes (0-1) |
search_folders |
[] |
Limit processing to specific folders (array) |
vector_dedup |
false |
Enable semantic deduplication via embeddings |
vector_threshold |
0.7 |
Similarity threshold for duplicate detection (0-1) |
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 obsidianki-0.9.1.tar.gz.
File metadata
- Download URL: obsidianki-0.9.1.tar.gz
- Upload date:
- Size: 58.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b21be465455586bff52328c8bc30a067bb91e30e85305a1d4d8c587d379ff158
|
|
| MD5 |
61a2f1269e2a640aec277d132f632b40
|
|
| BLAKE2b-256 |
932fb724bf38aaa4982fe4ca51fb0276827188cc0df14a7662191fa2fa88b5f5
|
Provenance
The following attestation bundles were made for obsidianki-0.9.1.tar.gz:
Publisher:
release.yml on ccmdi/obsidianki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianki-0.9.1.tar.gz -
Subject digest:
b21be465455586bff52328c8bc30a067bb91e30e85305a1d4d8c587d379ff158 - Sigstore transparency entry: 1264410290
- Sigstore integration time:
-
Permalink:
ccmdi/obsidianki@c470ccc4ab114dd4a6300b5e5e250219b8d8f915 -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/ccmdi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c470ccc4ab114dd4a6300b5e5e250219b8d8f915 -
Trigger Event:
push
-
Statement type:
File details
Details for the file obsidianki-0.9.1-py3-none-any.whl.
File metadata
- Download URL: obsidianki-0.9.1-py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad08f59d876b4667c635408733435aacbdfeb53c99fd47b9ea1336aa0150b9bb
|
|
| MD5 |
61eba4049c776300748e0c4d6727896b
|
|
| BLAKE2b-256 |
f4bb41c734dfd46effa4c3061ea223a11356bfbeb71cecfbc062859f9865b047
|
Provenance
The following attestation bundles were made for obsidianki-0.9.1-py3-none-any.whl:
Publisher:
release.yml on ccmdi/obsidianki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianki-0.9.1-py3-none-any.whl -
Subject digest:
ad08f59d876b4667c635408733435aacbdfeb53c99fd47b9ea1336aa0150b9bb - Sigstore transparency entry: 1264410538
- Sigstore integration time:
-
Permalink:
ccmdi/obsidianki@c470ccc4ab114dd4a6300b5e5e250219b8d8f915 -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/ccmdi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c470ccc4ab114dd4a6300b5e5e250219b8d8f915 -
Trigger Event:
push
-
Statement type: