NOTE: THIS PROJECT IS STILL AT AN EARLY DEVELOPMENT VERSION. TRY OUT WITH CARE AND EXPECT INTERFACE CHANGES.
CURRENT STATUS: Most read access is working and tested. Write access will be added soon.
Analyze and manipulate your Anki flashcards as a pandas DataFrame!
Pros:
- Use pandas to easily analyze or manipulate your Anki collection
- Just one line of code to get started
- Bring together information about cards, notes, models, decks in just one table!
- Easy installation (independent from your anki installation)
If your main goal is to add new cards, models and more, you can also take a look at the genanki project alternatively.
AnkiPandas
can be installed with the python package manager:
pip3 install ankipandas
For a local installation, you might want to use the --user
switch of pip
.
You can also update your current installation with pip3 install --upgrade ankipandas
.
For the latest development version you can also work from a cloned version of this repository:
git clone https://github.com/klieret/ankipandas/
cd ankipandas
pip3 install --user .
The simplest interface is that of an AnkiDataFrame
(a subclass of pandas DataFrame
):
It's as easy as this:
from ankipandas import AnkiDataFrame
cards = AnkiDataFrame.cards()
And you have a dataframe containing all cards, with additional methods that make many things easy. For example:
# For each card, merge all information from the corresponding note into
# the dataframe
cards.merge_notes(inplace=True)
# Add all fields from the notes as new columns to the dataframe (instead of
# being merged in one field ``flds`` as by default):
cards.fields_as_columns(inplace=True)
Take a look at the documentation to find out more about more about the available methods!
Get information about the columns in the table:
cards.help()
Most of this information is from the ankidroid documentation.
See the troubleshooting section in the documentation.
Your help is greatly appreciated! Suggestions, bug reports and feature requests are best opened as github issues. You could also first discuss in the gitter community. If you want to code something yourself, you are very welcome to submit a pull request!
This software is licenced under the MIT license.