← 返回
数据分析 Key 中文

Wanikani

Sync WaniKani Japanese learning progress data from the API to local storage for analysis and insights. Use when the user wants to backup their WaniKani progr...
将WaniKani日语学习进度数据从API同步到本地存储,以便进行分析和洞察。在用户想要备份其WaniKani进度时使用。
mart1n-xyz
数据分析 clawhub v1.0.0 1 版本 99879.5 Key: 需要
★ 0
Stars
📥 829
下载
💾 12
安装
1
版本
#latest

概述

WaniKani Sync

Sync your WaniKani progress data locally for analysis and insights generation.

Overview

This skill provides tools to fetch your WaniKani learning progress via the API and store it locally in SQLite. Once synced, you (or other services) can query the data to generate statistics, track learning patterns, visualize progress, and more.

Getting Your API Token

  1. Log into WaniKani
  2. Go to Settings → API Tokens
  3. Generate a new token (or use existing one)
  4. Copy the token (looks like a long alphanumeric string)

Security Note: Keep your token private. Never commit it to git or share it publicly.

Quick Start

Sync All Data

# Using environment variable (recommended)
export WANIKANI_API_TOKEN="your-token-here"
python3 scripts/sync.py

# Or pass token directly (less secure)
python3 scripts/sync.py --token "your-token-here"

# Store in specific directory
python3 scripts/sync.py --data-dir ~/wanikani-data

Sync Specific Data

# Only user info
python3 scripts/sync.py --user-only

# Only assignments (your progress on subjects)
python3 scripts/sync.py --assignments-only

# Only reviews
python3 scripts/sync.py --reviews-only

Force Full Sync

By default, the script does incremental sync (only fetching data updated since last sync). To force a full refresh:

python3 scripts/sync.py --full

Database Schema

The sync creates a wanikani.db SQLite database with these tables:

user

Your account info including level, subscription status, and start date.

assignments

Your progress on each subject (radicals, kanji, vocabulary). Tracks SRS stage, unlock/start/pass/burn timestamps.

level_progressions

Your journey through WaniKani levels with unlock/start/pass/completion timestamps.

reviews

Your review history with correctness counts and SRS stage changes.

review_statistics

Aggregated statistics per subject (correct/incorrect counts, streaks, percentages).

resets

Account reset history.

subjects

The actual learning content (kanji, vocabulary, radicals) with characters, meanings, readings, and mnemonics.

Sync subjects with:

# Sync all subjects (can be large!)
python3 scripts/sync.py --subjects-only

# Sync only specific levels (recommended)
python3 scripts/sync.py --with-subjects --subject-levels 1,2,3,4,5

# Include subjects in full sync
python3 scripts/sync.py --with-subjects

sync_meta

Internal table tracking last sync timestamps for incremental updates.

Common Queries

-- Current SRS stage distribution
SELECT srs_stage, COUNT(*) FROM assignments GROUP BY srs_stage;

-- Items burned per level
SELECT level, COUNT(*) FROM assignments WHERE burned_at IS NOT NULL GROUP BY level;

-- Average accuracy by subject type
SELECT subject_type, AVG(percentage_correct) FROM review_statistics GROUP BY subject_type;

-- Reviews done in last 7 days
SELECT DATE(created_at) as day, COUNT(*) FROM reviews
WHERE created_at > datetime('now', '-7 days') GROUP BY day;

-- Time spent at each level
SELECT level, started_at, passed_at,
       CASE WHEN passed_at IS NOT NULL
            THEN julianday(passed_at) - julianday(started_at)
            ELSE NULL END as days_to_pass
FROM level_progressions WHERE started_at IS NOT NULL;

-- Most problematic items (with subject characters)
SELECT 
    s.characters,
    s.object as type,
    rs.meaning_incorrect + rs.reading_incorrect as fails,
    rs.percentage_correct as accuracy
FROM review_statistics rs
JOIN subjects s ON rs.subject_id = s.id
WHERE rs.percentage_correct < 75
ORDER BY fails DESC
LIMIT 20;

-- Current leeches (Apprentice stage, failing often, with kanji)
SELECT 
    s.characters,
    s.object as type,
    a.srs_stage,
    rs.meaning_incorrect + rs.reading_incorrect as total_fails,
    rs.percentage_correct
FROM review_statistics rs
JOIN assignments a ON rs.subject_id = a.subject_id
JOIN subjects s ON rs.subject_id = s.id
WHERE a.srs_stage BETWEEN 1 AND 4
  AND rs.percentage_correct < 80
ORDER BY total_fails DESC
LIMIT 15;

API Notes

  • Rate limit: 60 requests/minute
  • All API requests use the v2 revision 20170710
  • Incremental sync uses updated_after filter to minimize API calls
  • See references/api-structure.md for complete endpoint documentation

Query Tools

After syncing, use the query helper for common reports:

# Show your worst leeches (items that keep falling back)
python3 scripts/queries.py leeches

# Show SRS distribution (Apprentice/Guru/Master/etc counts)
python3 scripts/queries.py srs

# Show level progression timeline
python3 scripts/queries.py levels

# Show critical items at risk of falling back
python3 scripts/queries.py critical

# Show accuracy by subject type
python3 scripts/queries.py accuracy

See references/example-queries.sql for raw SQL you can run directly on the database.

Files

  • scripts/sync.py - Main sync tool with CLI
  • scripts/queries.py - Query helper with common reports
  • references/api-structure.md - WaniKani API reference
  • references/example-queries.sql - SQL query examples

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 10:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,221
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,015
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,173