Skip to content

Generates learning flash cards as importable text files to the Anki application from images and formatted text using OpenRouter and OpenAI APIs.

License

Notifications You must be signed in to change notification settings

aureleon/image-a-fiche

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image -> Fiche !

The purpose of this tool is to translate both images from the AlterEgo A1 textbook, as well as formatted text (Markdown), into Anki-compatible flash cards.

Importing to Anki

All text files in anki-imports can be directly imported into Anki simply by using the "File -> Import" menu buttons, then selecting whichever text files you'd like.

Sources

The grammaire and lexique folders contain the source text / images, as well as the schemas / prompts utilized by the models to develop the intermediate forms and final JSON outputs, which are then translated into a CSV-style format.

Outputs

In anki-imports/lexique, there are flash cards generated from slightly modified images in the A1 textbook glossary, which are located in lexique/A1.

Currently there are no sources in grammaire, but I am planning to create a schema to make grammar related flash cards using the 'grammaire' appendix pages in the A1 textbook.

* The outputs will follow the same format: ./anki-imports/grammaire

Generation

Usage

usage: main [-h] -apikey APIKEY -schema SCHEMA -outd OUTPATH [-model MODEL] [-text [TEXTS]] [-image [IMAGES]] [-prompt PROMPT]

The program expects to receive a schema prompt, which will be the translation promptfor any source text to convert into an expected flash card JSON schema output.

If images are passed, then both the schema and prompt prompts are required to be passed, with the prompt input representing the OCR requirements going from image to output markdown.

* This program requires the use of an OpenRouter API key; create one here: OpenRouter API key

* You can specify your own LLM with the model flag, replacing the default: Gemma 3 27B LLM.

About

Generates learning flash cards as importable text files to the Anki application from images and formatted text using OpenRouter and OpenAI APIs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages