{"id":15106054,"url":"https://github.com/thisisnttheway/anki-deck-automation","last_synced_at":"2026-02-08T04:31:54.236Z","repository":{"id":222971395,"uuid":"755974738","full_name":"ThisIsntTheWay/anki-deck-automation","owner":"ThisIsntTheWay","description":"Automated Anki deck creation","archived":false,"fork":false,"pushed_at":"2024-02-28T12:58:01.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-21T20:05:45.637Z","etag":null,"topics":["anki","ankiconnect"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThisIsntTheWay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-11T16:22:31.000Z","updated_at":"2024-02-17T10:54:14.000Z","dependencies_parsed_at":"2024-02-27T19:30:30.564Z","dependency_job_id":"57de4064-aa38-4f53-acf7-24da041d1b64","html_url":"https://github.com/ThisIsntTheWay/anki-deck-automation","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.21875,"last_synced_commit":"8bb3c039f7d05ba59d709bfbde6e922907b818a7"},"previous_names":["thisisnttheway/abki-deck-automation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThisIsntTheWay/anki-deck-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsntTheWay%2Fanki-deck-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsntTheWay%2Fanki-deck-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsntTheWay%2Fanki-deck-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsntTheWay%2Fanki-deck-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThisIsntTheWay","download_url":"https://codeload.github.com/ThisIsntTheWay/anki-deck-automation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThisIsntTheWay%2Fanki-deck-automation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267018390,"owners_count":24022260,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","ankiconnect"],"created_at":"2024-09-25T21:00:35.055Z","updated_at":"2026-02-08T04:31:54.207Z","avatar_url":"https://github.com/ThisIsntTheWay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anki deck automation\nThis repo provides tools to automatically build and export an Anki deck.  \nWill require an active AnkiConnect instance.\n\n## Usage\nThe easiest way to use this tool is through a docker image:\n```bash\ndocker run -v $(pwd):/opt thisisnttheway/anki-deck-compiler:latest \u003canki_folder\u003e \u003canki_export_path\u003e \u003chost:port\u003e\n# Containerized, the script expects \u003canki_folder\u003e at /opt\n```\n- `\u003canki_folder\u003e` is the anki folder.\n- `\u003canki_export_path\u003e` is the absolute path of the exported deck file.\n- `\u003chost:port\u003e` is the AnkiConnect instance and must be specified as `\u003cip\u003e:\u003cport\u003e`.\n\nAlternatively, the repo can be cloned and dependencies manually installed:\n```bash\ngit clone https://github.com/ThisIsntTheWay/anki-deck-automation.git\ncd anki-deck-automation\npip install -r requirements.txt\n```\n\nTo assemble a deck, execute `assemble.py`:\n```bash\nassemble.py \u003canki_folder\u003e \u003canki_export_path\u003e \u003chost:port\u003e\n```\n\n_Additionally, the validity of the `anki` folder can be checked by running `check.py \u003cfolder\u003e`._\n\n\n### Folder structure\nThe script expects the following folder structure:\n```bash\nanki\n├── assets (OPTIONAL)\n│   ├── image.png\n│   └── audio.mp3\n├── card\n│   ├── back.html\n│   ├── front.html\n│   └── style.css\n├── config.yaml\n└── decks\n    ├── Subdeck 1.csv\n    └── Subdeck 2.csv\n        ...\n```\n\n- `assets`\n  - Media files used in the deck.\n  - Optional and only used if `webserver: true` is set in `config.yaml`\n- `card`\n  - Card template definitions.\n- `decks`\n  - CSV files of decks.\n    Each file gets rendered into its own subdeck, with the **file name** being the name of the deck.\n    - Assuming `singleDeck: false` in `config.yaml`.\n      If set to `true`, only a file called `main.csv` will be consumed.\n- `config.yaml`\n  - Contains deck information such as master deck name, model name and note fields.\n\n### Configuration\nThe file `/anki/config.yaml` contains configuration of the script and Anki deck itself.  \nIt must, at minimum, contain the following:\n```yaml\nmasterDeckName: test_deck\nmodelName: test_model\nfields:\n - question\n - answer\n```\n\n- `masterDeckName`\n  - Name of the (master) deck under which all subdecks will be stored under.\n- `modelName`\n  - Name of the model to create.\n- `fields`\n  - Fields for the model.\n \nAn [example `config.yaml`](https://github.com/ThisIsntTheWay/anki-deck-automation/blob/main/anki/config.yaml) can be found in `/anki`.\n\n### Decks\nDecks are defined as CSVs in `/anki/decks`.  \n\n\u003e [!NOTE]\n\u003e By default, the script will create subdecks using all available CSV files.  \n\u003e If `singleDeck: true` is set in the `config.yaml`, the script will instead create a single deck with the name `masterDeckName`.  \n\u003e In this case, the script will only consume a CSV file called `main.csv` in this folder.\n\nThe CSV header row contains the [fields](https://github.com/ThisIsntTheWay/anki-deck-automation/blob/a429841ff4c3492a94b0374684434bb377652ad2/anki/config.yaml#L3).  \nAll other rows specify the content for those fields:\n\n```csv\nquestion;answer;picture\nMy question 1;My answer 1;https://ex.com/red.png\nMy question 2;My answer 2;https://ex.com/green.png\nMy question 3;My answer 3;https://ex.com/blue.png\n```\n\n\u003e [!WARNING]  \n\u003e By default, the script assumes the `;` delimiter.  \n\u003e To change this, `csvDelimiter` in `config.yaml` can be set to a different value.  \n\u003e Only fields that are specified in `config.yaml` will actually be included in notes, apart from `tags` (See below).\n\n#### Tags\nTo add tags to notes, add them into the field `tags` in a CSV.  \nTags are separated using `,`.\n\n\u003e [!NOTE]\n\u003e It is not necessary to add `tags` to the fields in `config.yaml`.  \n\u003e Additionally, whitespaces will be stripped.  \n\n\n### Media\nTo add pictures/audio, create new fields containing either `image` or `audio` in their name (case insensitive).  \nFor example, the following field names would create an **audio** field:  \n- `Audio`\n- `AudioSentence`\n- `sentenceAudio`\n- `auxilliaryaudio`\n- `audio_word`\n\nIn the CSV, add URLs containing the respective media.  \nAnkiConnect will then use this URL to download the asset:\n\n```csv\nimage_fieldX;audio_fieldY\nhttps://ex.com/example.jpg;https://ex.com/example.mp3\n```\n\n\u003e [!NOTE]\n\u003e The script will check URLs before downloading them.  \n\u003e If the URL does not respond or does not return a media type, then the field gets skipped in the note.  \n\u003e This behaviour can be changed in `config.yaml` (shown are the defaults if not specified otherwise):\n\n```yaml\nurlCheck:\n  # Enable URL check\n  enabled: true\n  # Timeout, in seconds, of URL check\n  timeout: 1\n```\n\n#### Local media\nIf media only exists locally, a webserver can be launched that serves all files under `./anki/assets`.  \nThe webserver can be configured in the `config.yaml` as such (shown are the defaults if not specified otherwise):  \n\n```yaml\nwebserver:\n  # Enable webserver\n  enabled: true\n  # Listen port\n  port: 1233\n  # Listen address\n  listenAddress: 0.0.0.0\n```\n\nAssets can the be accessed at `http://\u003cip\u003e:\u003cport\u003e/\u003cfile\u003e`.  \n(E.g. `http://localhost:1233/file.mp3`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnttheway%2Fanki-deck-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisisnttheway%2Fanki-deck-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisisnttheway%2Fanki-deck-automation/lists"}