Package: memium
MemiumWhen you have to stop and look things up, it breaks up your flow. Adding this knowledge to long-term memory builds fluency, and being fluent at something makes it much more fun! The faster you can get from crawling to running, the more enjoyable it is.Unfortunately, we forget most of what we read,even stuff we care about.It turns out that if you ask questions of the texts you read, and ask those questions of yourself in the future, you learn much more! But writing questions and quizzing yourself can feel quite mechanical. What if you wrote questions as part of your notes, and then your computer could quiz you in the future? That's the purpose of Memium. It extracts questions from your notes likeQ. Why can spaced repetition result in more enjoyable learning?
A. It enables faster bootstrapping to proficiency, which is more fun!And adding them to a spaced repetition service likeAnki.This is an implementation of Andy Matuschak'sPersonal Mnemonic Medium.Use as an applicationIf you want to sync markdown notes to Anki, here's how to get started!In Anki, install theAnkiConnectadd-onCommand line interfaceInstall Memium in its own virtual environment with pipx,>pipxinstallmemiumImport your notes!> memium --input-dir [YOUR_INPUT_DIR]In Docker containerInstallOrbstackor Docker Desktop.Setup a container$INPUT_DIR="PATH_TO_YOUR_INPUT_DIR"dockerrun-i\--name=memium\-eHOST_INPUT_DIR=$INPUT_DIR\-v$INPUT_DIR:/input\--restartunless-stopped\ghcr.io/martinbernstorff/memium:latest\memium\--input-dir/input/This will start a docker container which updates your deck from$INPUT_DIR. In case of updated files, it will sync the difference (create new prompts and delete deleted prompts) to Anki.If you want to continuously sync the directory, set the--watch-seconds [UPDATE_SECONDS]argument as well.Keeping the package update can be a bit of a chore, which can be automated withWatchTower.Use as libraryIf you would like to build build your own Python application on top of the abstractions added here, you can install the library from pypi:pipinstallmemiumPipeline abstractionsThe library is built as a pipeline illustrated below. Left describes the abstract pipeline, defined by interfaces. The right path describes an implementation of those interfaces from markdown to Anki, which is available in the CLI.graph TD 
	FD["File on disk"]
        DP["Prompts at Destination"]
	FD -- DocumentSource --> Document
	Document -- PromptExtractor --> Prompt
	Prompt -- Destination --> DP
 
	MD["Markdown file"]
	Prompts["[QAPrompt | ClozePrompt]"]
        Anki["Cards in the Anki app"]
 
	MD -- MarkdownDocumentSource --> Document
	Document -- "[QAPromptExtractor, \nClozePromptExtractor]" --> Prompts
        Prompts -- AnkiConnectDestination --> AnkiContributingSetting up a dev environmentInstallOrbstackor Docker Desktop. Make sure to complete the full install process before continuing.If not installed, install VSCodePress thislinkComplete the setup processSubmitting a PRFeel free to submit pull requests! If you want to run the entire pipeline locally, run:invvalidate_ci💬 Where to ask questionsType🚨Bug ReportsGitHub Issue Tracker🎁Feature Requests & IdeasGitHub Issue Tracker👩‍💻Usage QuestionsGitHub Discussions🗯General DiscussionGitHub Discussions