A git repository for adding information from Anki to a text file of notes (is linked inside)

I extended some previous work to address the following situation:

Suppose a user keeps the ‘master’ copy of their flashcards in a spreadsheet on their desktop. When they make changes they do some processing in Python to make a text file and upload the text file to Anki. It can be useful for that user to also be able to easily insert information from Anki into their master sheet. For example, if each row in the sheet represents a note, the user may want to add various columns to the sheet like the days since last review (for any card on the note), the days since lapsed, fields with the flags, intervals, difficulty, for each card type for the note, etc.

I added some example code to a repository I had previously created that shows how to replicate most statistics from the statistics window in Anki software in Python. The example code assumes the user has a text file of notes and the program creates an output file with the same number of rows as the input file with some columns added. These include default columns (days since last review, days since last lapse) and other card-specific columns (card flags, intervals, etc.) specified by the user.

This isn’t the most elegant solution, as the user then pastes these columns back into their master sheet, although there are probably other methods of inserting this info.

The repository is linked below. The current release is v1.2.0.

What changes are you making in Python? I just export my spreadsheet to a CSV and then import that into my deck(s).