Load your anki database as a pandas DataFrame with just one line of code!
Project description
Description
Analyze and manipulate your Anki flashcards as a pandas DataFrame!
Pros:
Installation
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 .
Usage
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_note_info(inplace=True)
# Add deck names (rather than just IDs)
cards.add_deck_names(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.add_fields_as_columns(inplace=True)
Take a look at the documentation to find out more about more about the available methods!
The basic implementation is done in a functional way, so if you prefer the vanilla pandas DataFrame, you can also just use these functions to manipulate them. Again, the documentation is a good starting point!
Columns
Get information about the fields in the table:
cards.help()
Most of this information is from the ankidroid documentation.
Common problems
Locked database: While Anki is running, your database will be locked and you might not be able to access it. Simply close Anki and try again.
Any other problems? Please open an issue.
License
This software is licenced under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ankipandas-0.0.dev4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc3c4d22c0691a06f066862395afe02bc8b692763c012539a3d8d5bddb59eb7 |
|
MD5 | 83ddeea2588afcdd6a365513d1478e73 |
|
BLAKE2b-256 | e9e894fb55cfe54fd3c6f534aa18942f4e78a17fbaca285cfecdeeffc71d580b |