Skip to main content

Generate flashcards from Obsidian notes using AI and sync them to Anki

Project description

ObsidianKi

Automated flashcard generation to Anki from your Obsidian vault.

Preview

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

Setup

Run:

obsidianki

This will start the interactive setup. Here's what you'll need:

  1. Obsidian Local REST API plugin setup:

    • Install plugin in Obsidian
    • Copy the API key from plugin settings
  2. Anthropic API key:

  3. AnkiConnect setup:

    • Add-on code: 2055492159
    • Keep Anki running

You can then follow the interactive setup and edit the configuration as you like.

Usage

Basic Usage

obsidianki                   # Generate flashcards
oki                          # Alias

Configuration Management

oki config                   # Show config commands
oki config list              # List all settings
oki config get max_cards     # Get specific setting
oki config set max_cards 15  # Update setting

Tag Management

oki tag                      # Show tag commands
oki tag list                 # List tag weights and exclusions
oki tag add python 2.0       # Add/update tag weight
oki tag remove python        # Remove tag weight
oki tag exclude boring       # Exclude notes with 'boring' tag
oki tag include boring       # Remove 'boring' from exclusion list

Note Selection

oki --notes "React" "JavaScript"     # Process specific notes
oki --cards 10                       # Generate up to 10 cards total
oki --notes "React" "JavaScript" --cards 6  # Generate ~3 cards per note (6 total)
oki --notes "React" --cards 6        # Generate ~6 cards from React note

# Directory patterns
oki --notes "path/to/files/*"      # Process all notes in directory
oki --notes "path/*" --sample 5          # Sample 5 random notes from directory
oki --notes "path/*" --sample 10 --bias 1 # Sample with maximum bias against over-processed notes

Query Mode

# Make flashcard without source note
oki -q "how to center a div"
oki -q "CSS flexbox" --cards 8

# Targeted extraction from source note(s)
oki --notes "React" -q "error handling"
oki --notes "JavaScript" "TypeScript" -q "async patterns" --cards 6

Deck Management

oki --deck "Programming"             # Add cards to specific deck
oki -q "Python basics" --deck "CS"  # Query mode with custom deck
oki config set deck "MyDeck"         # Change default deck

How it works

Standard Mode

  1. Finds old notes in your vault (configurable age threshold)
  2. Weights notes by tags and processing history (avoids over-processed notes)
  3. Generates flashcards using Claude 4 Sonnet
  4. Creates cards in Anki "Obsidian" deck (or DECK set in config)

Query Modes

  • Standalone: Generates flashcards from AI knowledge alone based on your query
  • Targeted: Extracts specific information from selected notes based on your query

Other features

Custom flashcard type: Includes clickable "Origin" field that opens the source note

Deduplication: History-based and deck-based options to avoid the same repeated content

Statistics: View generation history and top notes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidianki-0.5.2.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidianki-0.5.2-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file obsidianki-0.5.2.tar.gz.

File metadata

  • Download URL: obsidianki-0.5.2.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.11

File hashes

Hashes for obsidianki-0.5.2.tar.gz
Algorithm Hash digest
SHA256 f2781c74effae2d7d3d0305062e69110e0759a21a4c76f886f5154372a344c02
MD5 31ded0425a2e4b367c109902d31be1ec
BLAKE2b-256 d0bf7614649ec8b6c1074690f3a3b509042a1bf1079dd5f5d22c4f70c2eef1a2

See more details on using hashes here.

File details

Details for the file obsidianki-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: obsidianki-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.11

File hashes

Hashes for obsidianki-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a7d090da8cfa1de386638f4cbb44a8993939abca574e77a85862913f13285fab
MD5 85a2e7f13c7fdd16b930d9e88da2d9b6
BLAKE2b-256 b3bbfc752e61219ecb81db70dd363d1898edd25059e4ddf2b6d485d35d1121fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page