{"id":15017271,"url":"https://github.com/klieret/ankipandas","last_synced_at":"2025-10-25T23:50:37.841Z","repository":{"id":34649673,"uuid":"181918652","full_name":"klieret/AnkiPandas","owner":"klieret","description":"Analyze and manipulate your Anki flashcards using pandas dataframes!","archived":false,"fork":false,"pushed_at":"2025-04-07T21:35:43.000Z","size":780,"stargazers_count":140,"open_issues_count":23,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-16T11:02:44.585Z","etag":null,"topics":["anki","anki-addon","anki21","pandas","pandas-dataframes","spaced-repetition"],"latest_commit_sha":null,"homepage":"https://ankipandas.rtfd.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klieret.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2019-04-17T15:24:35.000Z","updated_at":"2025-05-13T09:33:09.000Z","dependencies_parsed_at":"2024-06-20T23:22:27.968Z","dependency_job_id":"21154d7d-c90b-49c8-84e7-a30a6e9a24bd","html_url":"https://github.com/klieret/AnkiPandas","commit_stats":{"total_commits":520,"total_committers":13,"mean_commits":40.0,"dds":0.5096153846153846,"last_synced_commit":"ce117345cdf8f99379cc644e32559950f067b67e"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klieret%2FAnkiPandas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klieret%2FAnkiPandas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klieret%2FAnkiPandas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klieret%2FAnkiPandas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klieret","download_url":"https://codeload.github.com/klieret/AnkiPandas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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","anki-addon","anki21","pandas","pandas-dataframes","spaced-repetition"],"created_at":"2024-09-24T19:50:14.576Z","updated_at":"2025-10-25T23:50:37.735Z","avatar_url":"https://github.com/klieret.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://ankipandas.readthedocs.io/\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/klieret/AnkiPandas/master/misc/logo/logo_github.png\"\u003e\u003c/a\u003e\n\u003cp align=\"center\"\u003e\n\u003cem\u003eAnalyze and manipulate your Anki collection using pandas!\u003c/em\u003e\n\u003c/p\u003e\n\u003c/a\u003e\n\u003cp\u003e\n\n[![Documentation Status](https://readthedocs.org/projects/ankipandas/badge/?version=latest)](https://ankipandas.readthedocs.io/) [![Gitter](https://img.shields.io/gitter/room/ankipandas/community.svg)](https://matrix.to/#/#AnkiPandas_community:gitter.im)\n[![License](https://img.shields.io/github/license/klieret/ankipandas.svg)](https://github.com/klieret/ankipandas/blob/master/LICENSE.txt)\n[![PR welcome](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg)](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)\n\n\u003c/p\u003e\n\u003cp\u003e\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/klieret/AnkiPandas/master.svg)](https://results.pre-commit.ci/latest/github/klieret/AnkiPandas/master)\n[![gh actions](https://github.com/klieret/AnkiPandas/workflows/testing/badge.svg)](https://github.com/klieret/AnkiPandas/actions) [![Coveralls](https://coveralls.io/repos/github/klieret/AnkiPandas/badge.svg?branch=master)](https://coveralls.io/github/klieret/AnkiPandas?branch=master)\n[![CodeQL](https://github.com/klieret/AnkiPandas/actions/workflows/codeql.yml/badge.svg)](https://github.com/klieret/AnkiPandas/actions/workflows/codeql.yml)\n[![gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n[![Pypi status](https://badge.fury.io/py/ankipandas.svg)](https://pypi.org/project/ankipandas/)\n\n\u003c/p\u003e\n\u003c/div\u003e\n\n## 📝 Description\n\n\u003e **Note**\n\u003e This package needs a new maintainer, as I currently do not have enough time to continue development\n\u003e of this package. Writing modifications back into the Anki database is currently disabled,\n\u003e in particular because of issue [#137](https://github.com/klieret/AnkiPandas/issues/137).\n\u003e Please reach out to me if you are interested in getting involved!\n\n[Anki](https://apps.ankiweb.net/) is one of the most popular flashcard\nsystem for spaced repetition learning,\n[pandas](https://pandas.pydata.org/) is the most popular python package\nfor data analysis and manipulation. So what could be better than to\nbring both together?\n\nWith `AnkiPandas` you can use `pandas` to easily analyze or manipulate\nyour Anki flashcards.\n\n**Features**:\n\n-   **Select**: Easily select arbitrary subsets of your cards, notes or\n    reviews using `pandas` ([one of many\n    introductions](https://medium.com/dunder-data/6fcd0170be9c),\n    [official\n    documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html))\n-   **Visualize**: Use pandas\\' powerful [built in\n    tools](https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html)\n    or switch to the even more versatile\n    [seaborn](https://seaborn.pydata.org/) (statistical analysis) or\n    [matplotlib](https://matplotlib.org/) libraries\n-   **Manipulate**: Apply fast bulk operations to the table (e.g. add\n    tags, change decks, set field contents, suspend cards, \\...) or\n    iterate over the table and perform these manipulations step by step.\n    **⚠️ This functionality is currently disabled until [#137](https://github.com/klieret/AnkiPandas/issues/137) has been resolved! ⚠️**\n-   **Import and Export**: Pandas can export to (and import from) csv,\n    MS Excel, HTML, JSON, \\... ([io\n    documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html))\n\n**Pros**:\n\n-   **Easy installation**: Install via python package manager\n    (independent of your Anki installation)\n-   **Simple**: Just one line of code to get started\n-   **Convenient**: Bring together information about\n    [cards](https://apps.ankiweb.net/docs/manual.html#cards),\n    [notes](https://apps.ankiweb.net/docs/manual.html#notes-\u0026-fields),\n    [models](https://apps.ankiweb.net/docs/manual.html#note-types),\n    [decks](https://apps.ankiweb.net/docs/manual.html#decks) and more in\n    just one table!\n-   **Fully documented**: Documentation on [readthedocs](https://ankipandas.readthedocs.io/)\n-   **Well tested**: More than 100 unit tests to keep everything in\n    check\n\nAlternatives: If your main goal is to add new cards, models and more,\nyou can also take a look at the\n[genanki](https://github.com/kerrickstaley/genanki) project.\n\n## 📦 Installation\n\n`AnkiPandas` is available as [pypi\npackage](https://pypi.org/project/ankipandas/) and can be installed or\nupgrade with the [python package\nmanager](https://pip.pypa.io/en/stable/):\n\n```sh\npip3 install --user --upgrade ankipandas\n```\n\n### Development installation\n\nFor the latest development version you can also work from a cloned\nversion of this repository:\n\n```sh\ngit clone https://github.com/klieret/ankipandas/\ncd ankipandas\npip3 install --user --upgrade --editable .\n```\n\nIf you want to help develop this package further, please also install the\n[pre-commit](https://pre-commit.ci/) hooks and use [gitmoji](https://gitmoji.dev/):\n\n```sh\npre-commit install\ngitmoji -i\n```\n\n## 🔥 Let's get started!\n\nStarting up is as easy as this:\n\n```python\nfrom ankipandas import Collection\n\ncol = Collection()\n```\n\nAnd `col.notes` will be dataframe containing all notes, with additional\nmethods that make many things easy. Similarly, you can access cards or\nreviews using `col.cards` or `col.revs`.\n\nIf called without any argument `Collection()` tries to find your Anki\ndatabase by itself. However this might take some time. To make it\neasier, simply supply (part of) the path to the database and (if you\nhave more than one user) your Anki user name, e.g.\n`Collection(\".local/share/Anki2/\", user=\"User 1\")` on many Linux\ninstallations.\n\nTo get information about the interpretation of each column, use\n`print(col.notes.help_cols())`.\n\nTake a look at the [documentation](https://ankipandas.readthedocs.io/)\nto find out more about more about the available methods!\n\nSome basic examples:\n\n## 📈 Analysis\n\n**More examples**: [Analysis\ndocumentation](https://ankipandas.readthedocs.io/en/latest/examples.html),\n[projects that use `AnkiPandas`](https://ankipandas.readthedocs.io/en/latest/projects_with_ap.html).\n\nShow a histogram of the number of reviews (repetitions) of each card for\nall decks:\n\n```python\ncol.cards.hist(column=\"creps\", by=\"cdeck\")\n```\n\nShow the number of leeches per deck as pie chart:\n\n```python\ncards = col.cards.merge_notes()\nselection = cards[cards.has_tag(\"leech\")]\nselection[\"cdeck\"].value_counts().plot.pie()\n```\n\nFind all notes of model `MnemoticModel` with empty `Mnemotic` field:\n\n```python\nnotes = col.notes.fields_as_columns()\nnotes.query(\"model=='MnemoticModel' and 'Mnemotic'==''\")\n```\n\n## 🛠️ Manipulations\n\n\u003e **Warning**\n\u003e Writing the database has currently been disabled until\n\u003e [#137](https://github.com/klieret/AnkiPandas/issues/137) has been resolved.\n\u003e Help is much appreciated!\n\n\u003e **Warning**\n\u003e **Please be careful and test this well!**\n\u003e Ankipandas will create a backup of your database before writing, so you can always restore the previous state. Please make sure that everything is working before continuing to use Anki normally!\n\nAdd the `difficult-japanese` and `marked` tag to all notes that contain\nthe tags `Japanese` and `leech`:\n\n```python\nnotes = col.notes\nselection = notes[notes.has_tags([\"Japanese\", \"leech\"])]\nselection = selection.add_tag([\"difficult-japanese\", \"marked\"])\ncol.notes.update(selection)\ncol.write(modify=True)  # Overwrites your database after creating a backup!\n```\n\nSet the `language` field to `English` for all notes of model\n`LanguageModel` that are tagged with `English`:\n\n```python\nnotes = col.notes\nselection = notes[notes.has_tag([\"English\"])].query(\"model=='LanguageModel'\").copy()\nselection.fields_as_columns(inplace=True)\nselection[\"language\"] = \"English\"\ncol.notes.update(selection)\ncol.write(modify=True)\n```\n\nMove all cards tagged `leech` to the deck `Leeches Only`:\n\n```python\ncards = col.cards\nselection = cards[cards.has_tag(\"leech\")]\nselection[\"cdeck\"] = \"Leeches Only\"\ncol.cards.update(selection)\ncol.write(modify=True)\n```\n\n## 🐞 Troubleshooting\n\nSee the [troubleshooting section in the\ndocumentation](https://ankipandas.readthedocs.io/en/latest/troubleshooting.html).\n\n## 💖 Contributing\n\nYour help is greatly appreciated! Suggestions, bug reports and feature\nrequests are best opened as [github\nissues](https://github.com/klieret/ankipandas/issues). You could also\nfirst discuss in the [gitter\ncommunity](https://matrix.to/#/#AnkiPandas_community:gitter.im). If you want to code\nsomething yourself, you are very welcome to submit a [pull\nrequest](https://github.com/klieret/AnkiPandas/pulls)!\n\nBug reports and pull requests are credited with the help of the [allcontributors bot](https://allcontributors.org/).\n\n## 📃 License \u0026 Disclaimer\n\nThis software is licenced under the [MIT\nlicense](https://github.com/klieret/ankipandas/blob/master/LICENSE.txt)\nand (despite best testing efforts) comes **without any warranty**. The\nlogo is inspired by the [Anki\nlogo](https://github.com/ankitects/anki/blob/main/qt/aqt/data/web/imgs/anki-logo-thin.png)\n([license](https://github.com/ankitects/anki/blob/main/LICENSE)) and\nthe logo of the pandas package\n([license2](https://github.com/pandas-dev/pandas/blob/main/LICENSE)).\nThis library and its author(s) are not affiliated/associated with the\nmain Anki or pandas project in any way.\n\n## ✨ Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Blocked\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4366503?v=4?s=100\" width=\"100px;\" alt=\"Blocked\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBlocked\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3ABlocked\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/CalculusAce\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/42630988?v=4?s=100\" width=\"100px;\" alt=\"CalculusAce\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCalculusAce\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3ACalculusAce\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://frnsys.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1059947?v=4?s=100\" width=\"100px;\" alt=\"Francis Tseng\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFrancis Tseng\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3Afrnsys\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=frnsys\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/khughitt\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/125001?v=4?s=100\" width=\"100px;\" alt=\"Keith Hughitt\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKeith Hughitt\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3Akhughitt\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/eumiro\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6774676?v=4?s=100\" width=\"100px;\" alt=\"Miroslav Šedivý\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMiroslav Šedivý\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=eumiro\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=eumiro\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/bollwyvl\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/45380?v=4?s=100\" width=\"100px;\" alt=\"Nicholas Bollweg\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNicholas Bollweg\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=bollwyvl\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://thomasbrownback.com/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/26754?v=4?s=100\" width=\"100px;\" alt=\"Thomas Brownback\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eThomas Brownback\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3Abrownbat\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"http://esrh.sdf.org\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/16175276?v=4?s=100\" width=\"100px;\" alt=\"eshrh\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eeshrh\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=eshrh\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/exc4l\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/74188442?v=4?s=100\" width=\"100px;\" alt=\"exc4l\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eexc4l\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3Aexc4l\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/klieret/AnkiPandas/commits?author=exc4l\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/p4nix\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/7038116?v=4?s=100\" width=\"100px;\" alt=\"p4nix\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ep4nix\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/klieret/AnkiPandas/issues?q=author%3Ap4nix\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklieret%2Fankipandas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklieret%2Fankipandas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklieret%2Fankipandas/lists"}