{"id":13822185,"url":"https://github.com/tsudoko/anki-sync-server","last_synced_at":"2025-04-05T08:08:15.249Z","repository":{"id":37492979,"uuid":"63822562","full_name":"tsudoko/anki-sync-server","owner":"tsudoko","description":"Self-hosted Anki sync server","archived":false,"fork":false,"pushed_at":"2021-03-15T01:30:24.000Z","size":432,"stargazers_count":492,"open_issues_count":37,"forks_count":81,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-29T07:08:50.885Z","etag":null,"topics":["anki","ankiweb","server","sync"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsudoko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-20T23:56:40.000Z","updated_at":"2025-03-15T05:34:24.000Z","dependencies_parsed_at":"2022-09-07T12:02:44.761Z","dependency_job_id":null,"html_url":"https://github.com/tsudoko/anki-sync-server","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsudoko%2Fanki-sync-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsudoko%2Fanki-sync-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsudoko%2Fanki-sync-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsudoko%2Fanki-sync-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsudoko","download_url":"https://codeload.github.com/tsudoko/anki-sync-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","ankiweb","server","sync"],"created_at":"2024-08-04T08:01:47.490Z","updated_at":"2025-04-05T08:08:15.227Z","avatar_url":"https://github.com/tsudoko.png","language":"Python","readme":"ankisyncd\n=========\n\n[Anki][] is a powerful open source flashcard application, which helps you\nquickly and easily memorize facts over the long term utilizing a spaced\nrepetition algorithm. Anki's main form is a desktop application (for Windows,\nLinux and macOS) which can sync to a web version (AnkiWeb) and mobile\nversions for Android and iOS.\n\nThis is a personal Anki server, which you can sync against instead of\nAnkiWeb. It was originally developed by [David Snopek](https://github.com/dsnopek)\nto support the flashcard functionality on Bibliobird, a web application for\nlanguage learning.\n\nThis version is a fork of [jdoe0/ankisyncd](https://github.com/jdoe0/ankisyncd).\nIt supports Python 3 and Anki 2.1.\n\n[Anki]: https://apps.ankiweb.net/\n[dsnopek's Anki Sync Server]: https://github.com/dsnopek/anki-sync-server\n\n\u003cdetails open\u003e\u003csummary\u003eContents\u003c/summary\u003e\n\n - [Installing](#installing)\n - [Installing (Docker)](#installing-docker)\n - [Setting up Anki](#setting-up-anki)\n   - [Anki 2.1](#anki-21)\n   - [Anki 2.0](#anki-20)\n   - [AnkiDroid](#ankidroid)\n - [Running `ankisyncd` without `pyaudio`](#running-ankisyncd-without-pyaudio)\n   - [Anki ≥2.1.9](#anki-219)\n   - [Older versions](#older-versions)\n - [ENVVAR configuration overrides](#envvar-configuration-overrides)\n - [Support for other database backends](#support-for-other-database-backends)\n\u003c/details\u003e\n\nInstalling\n----------\n\n0. Install Anki. The currently supported version range is 2.1.1〜2.1.11, with the\n   exception of 2.1.9\u003csup id=\"readme-fn-01b\"\u003e[1](#readme-fn-01)\u003c/sup\u003e. (Keep in\n   mind this range only applies to the Anki used by the server, clients can be\n   as old as 2.0.27 and still work.) Running the server with other versions might\n   work as long as they're not 2.0.x, but things might break, so do it at your\n   own risk. If for some reason you can't get the supported Anki version easily\n   on your system, you can use `anki-bundled` from this repo:\n\n        $ git submodule update --init\n        $ cd anki-bundled\n        $ pip install -r requirements.txt\n\n   Keep in mind `pyaudio`, a dependency of Anki, requires development headers for\n   Python 3 and PortAudio to be present before running `pip`. If you can't or\n   don't want to install these, you can try [patching Anki](#running-ankisyncd-without-pyaudio).\n\n1. Install the dependencies:\n\n        $ pip install webob\n\n2. Modify ankisyncd.conf according to your needs\n\n3. Create user:\n\n        $ ./ankisyncctl.py adduser \u003cusername\u003e\n\n4. Run ankisyncd:\n\n        $ python -m ankisyncd\n\n---\n\n\u003cspan id=\"readme-fn-01\"\u003e\u003c/span\u003e\n1. 2.1.9 is not supported due to [commit `95ccbfdd3679`][] introducing the\n   dependency on the `aqt` module, which depends on PyQt5. The server should\n   still work fine if you have PyQt5 installed. This has been fixed in\n   [commit `a389b8b4a0e2`][], which is a part of the 2.1.10 release.\n[↑](#readme-fn-01b)\n\n[commit `95ccbfdd3679`]: https://github.com/dae/anki/commit/95ccbfdd3679dd46f22847c539c7fddb8fa904ea\n[commit `a389b8b4a0e2`]: https://github.com/dae/anki/commit/a389b8b4a0e209023c4533a7ee335096a704079c\n\nInstalling (Docker)\n-------------------\n\nFollow [these instructions](https://github.com/kuklinistvan/docker-anki-sync-server#usage).\n\nSetting up Anki\n---------------\n\n### Anki 2.1\n\nCreate a new directory in [the add-ons folder][addons21] (name it something\nlike ankisyncd), create a file named `__init__.py` containing the code below\nand put it in the `ankisyncd` directory.\n\n    import anki.sync, anki.hooks, aqt\n\n    addr = \"http://127.0.0.1:27701/\" # put your server address here\n    anki.sync.SYNC_BASE = \"%s\" + addr\n    def resetHostNum():\n        aqt.mw.pm.profile['hostNum'] = None\n    anki.hooks.addHook(\"profileLoaded\", resetHostNum)\n\n### Anki 2.0\n\nCreate a file (name it something like ankisyncd.py) containing the code below\nand put it in `~/Anki/addons`.\n\n    import anki.sync\n\n    addr = \"http://127.0.0.1:27701/\" # put your server address here\n    anki.sync.SYNC_BASE = addr\n    anki.sync.SYNC_MEDIA_BASE = addr + \"msync/\"\n\n[addons21]: https://apps.ankiweb.net/docs/addons.html#_add_on_folders\n\n### AnkiDroid\n\nAdvanced → Custom sync server\n\nUnless you have set up a reverse proxy to handle encrypted connections, use\n`http` as the protocol. The port will be either the default, 27701, or\nwhatever you have specified in `ankisyncd.conf` (or, if using a reverse proxy,\nwhatever port you configured to accept the front-end connection).\n\n**Do not use trailing slashes.**\n\nEven though the AnkiDroid interface will request an email address, this is not\nrequired; it will simply be the username you configured with `ankisyncctl.py\nadduser`.\n\nRunning `ankisyncd` without `pyaudio`\n-------------------------------------\n\n`ankisyncd` doesn't use the audio recording feature of Anki, so if you don't\nwant to install PortAudio, you can edit some files in the `anki-bundled`\ndirectory to exclude `pyaudio`:\n\n### Anki ≥2.1.9\n\nJust remove \"pyaudio\" from requirements.txt and you're done. This change has\nbeen introduced in [commit `ca710ab3f1c1`][].\n\n[commit `ca710ab3f1c1`]: https://github.com/dae/anki/commit/ca710ab3f1c1174469a3b48f1257c0fc0ce624bf\n\n### Older versions\n\nFirst go to `anki-bundled`, then follow one of the instructions below. They all\ndo the same thing, you can pick whichever one you're most comfortable with.\n\nManual version: remove every line past \"# Packaged commands\" in anki/sound.py,\nremove every line starting with \"pyaudio\" in requirements.txt\n\n`ed` version:\n\n    $ echo '/# Packaged commands/,$d;w' | tr ';' '\\n' | ed anki/sound.py\n    $ echo '/^pyaudio/d;w' | tr ';' '\\n' | ed requirements.txt\n\n`sed -i` version:\n\n    $ sed -i '/# Packaged commands/,$d' anki/sound.py\n    $ sed -i '/^pyaudio/d' requirements.txt\n\nENVVAR configuration overrides\n------------------------------\n\nConfiguration values can be set via environment variables using `ANKISYNCD_` prepended\nto the uppercase form of the configuration value. E.g. the environment variable,\n`ANKISYNCD_AUTH_DB_PATH` will set the configuration value `auth_db_path`\n\nEnvironment variables override the values set in the `ankisyncd.conf`.\n\nSupport for other database backends\n-----------------------------------\n\nsqlite3 is used by default for user data, authentication and session persistence.\n\n`ankisyncd` supports loading classes defined via config that manage most\npersistence requirements (the media DB and files are being worked on). All that is\nrequired is to extend one of the existing manager classes and then reference those\nclasses in the config file. See ankisyncd.conf for example config.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsudoko%2Fanki-sync-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsudoko%2Fanki-sync-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsudoko%2Fanki-sync-server/lists"}