anki-sync-server/README.md
2018-08-22 14:45:38 +02:00

2.3 KiB

ankisyncd

Anki is a powerful open source flashcard application, which helps you quickly and easily memorize facts over the long term utilizing a spaced repetition algorithm. Anki's main form is a desktop application (for Windows, Linux and macOS) which can sync to a web version (AnkiWeb) and mobile versions for Android and iOS.

This is a personal Anki server, which you can sync against instead of AnkiWeb. It was originally developed to support the flashcard functionality on Bibliobird, a web application for language learning.

This version is a fork of jdoe0/ankisyncd. It supports Python 3 and Anki 2.1.

Installing

  1. Install Anki. The server currently works well with 2.1.1. Running the server with other versions might work, but things might break, so do it at your own risk. Anki 2.0.x definitely isn't going to work, as it's written in Python 2, whereas ankisyncd runs only on Python 3.5 and later. If for some reason you can't get the supported Anki version easily on your system, you can use anki-bundled from this repo:

     $ git submodule update --init
     $ cd anki
     $ pip install -r requirements.txt
    
  2. Install the dependencies:

     $ pip install webob
    
  3. Modify ankisyncd.conf according to your needs

  4. Create user:

     $ ./ankisyncctl.py adduser <username>
    
  5. Run ankisyncd:

     $ python -m ankisyncd ankisyncd.conf
    

Setting up Anki

Anki 2.1

Create a new directory in ~/Anki/addons21 (name it something like ankisyncd), create a file named __init__.py containing the code below and put it in ~/Anki/addons21/ankisyncd.

import anki.sync

anki.sync.SYNC_BASE = 'http://127.0.0.1:27701/%s'

Anki 2.0

To make Anki use ankisyncd as its sync server, create a file (name it something like ankisyncd.py) containing the code below and put it in ~/Anki/addons.

import anki.sync

anki.sync.SYNC_BASE = 'http://127.0.0.1:27701/'
anki.sync.SYNC_MEDIA_BASE = 'http://127.0.0.1:27701/msync/'

Replace 127.0.0.1 with the IP address or the domain name of your server if ankisyncd is not running on the same machine as Anki.