MCPcopy Index your code
hub / github.com/ankicommunity/ankicommunity-api-server

github.com/ankicommunity/ankicommunity-api-server @0.0.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.9 ↗ · + Follow
452 symbols 1,994 edges 35 files 52 documented · 12% updated 22mo ago★ 5215 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

djankiserv

djankiserv is an open source Django-based implementation of a synchronisation server for Anki 2.1+. It includes a user manager (the native Django user system).

InstallationConnecting Anki to the sync server - Development - Contributing

About this implementation

This implementation was initially developed in order to support the spaced repetition functionality for Transcrobes, an open source language learning platform/ecosystem.

Any requests or functionality that don't interfere with using this project for that will definitely be entertained. Ideally the server would do everything that Ankiweb does, and much more. PRs are obviously always welcome!

Technical differences

Unlike the other popular open source Anki synchronisation server anki-sync-server, djankiserv stores the user data in a "proper" RDBMS. There are two 'database connections' that can be set - those for the 'system' (sessions, users, etc.) and those for user data. The 'system' stuff is just plain old Django, so any supported database can be used. The user data part currently uses either postgresql schemas or mysql databases, and currently only supports those two, though supporting other RDBMSes will definitely be considered later. sqlite3 is an embedded database and works great for that. It is not appropriate for use in modern web applications in the opinion of the maintainer, so will never be supported by djankiserv.

There is a basic API for getting certain, per-user collection-related information (decks, deck configuration, models, tags) and also notes for a given user. It may evolve to include other functions, statistics and even doing cards, though the focus is currently on getting and maintaining proper synchronisation as well as the basic API for notes.

Limitations

This is alpha software with some occasional data loss bugs. It works, sorta, if you hold it right. If it kills your kittens then you were forewarned!

Current known limitations (bugs!):

  • it doesn't support abort and if it crashes in the middle of a sync then the server will have a corrupt view of the database. You should force an upload sync on next synchronisation if this ever happens!
  • The v2 scheduler is not supported, and it is unclear how difficult this might be to implement.

Core symbols most depended-on inside this repo

load_json_asset
called by 82
tests/__init__.py
load_db_to_dict
called by 62
tests/__init__.py
execute
called by 51
src/djankiserv/unki/download.py
_standard_no_diff_test
called by 47
tests/__init__.py
get
called by 42
src/djankiserv/unki/decks.py
load_db_asset
called by 34
tests/__init__.py
hostKey
called by 34
tests/__init__.py
meta
called by 30
tests/__init__.py

Shape

Method 368
Function 54
Class 28
Route 2

Languages

Python100%

Modules by API surface

tests/test_sync_up.py68 symbols
tests/test_sync_down.py67 symbols
tests/__init__.py53 symbols
src/djankiserv/unki/collection.py44 symbols
src/djankiserv/sync/__init__.py31 symbols
src/djankiserv/unki/decks.py29 symbols
src/djankiserv/unki/sched.py26 symbols
src/djankiserv/unki/database.py24 symbols
src/djankiserv/sync/views.py21 symbols
src/djankiserv/unki/__init__.py17 symbols
src/djankiserv/unki/models.py16 symbols
src/djankiserv/unki/notes.py14 symbols

For agents

$ claude mcp add ankicommunity-api-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact