Skip to main content

Memium

Project description

Memium

Open in Dev Container PyPI Python Version Roadmap

When 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 like

Q. 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 like Anki.

This is an implementation of Andy Matuschak's Personal Mnemonic Medium.

Use as an application

If you want to sync markdown notes to Anki, here's how to get started!

  1. In Anki, install the AnkiConnect add-on

Command line interface

  1. Install Memium in its own virtual environment with pipx,
> pipx install memium
  1. Import your notes!
> memium --input-dir [YOUR_INPUT_DIR]

In Docker container

  1. Install Orbstack or Docker Desktop.
  2. Setup a container
$INPUT_DIR="PATH_TO_YOUR_INPUT_DIR"

docker run -i \
  --name=memium \
  -e HOST_INPUT_DIR=$INPUT_DIR \
  -v $INPUT_DIR:/input \
  --restart unless-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 with WatchTower.

Use as library

If you would like to build build your own Python application on top of the abstractions added here, you can install the library from pypi:

pip install memium

Pipeline abstractions

The 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 --> Anki

Contributing

Setting up a dev environment

  1. Install Orbstack or Docker Desktop. Make sure to complete the full install process before continuing.
  2. If not installed, install VSCode
  3. Press this link
  4. Complete the setup process

Submitting a PR

Feel free to submit pull requests! If you want to run the entire pipeline locally, run:

inv validate_ci

💬 Where to ask questions

Type
🚨 Bug Reports GitHub Issue Tracker
🎁 Feature Requests & Ideas GitHub Issue Tracker
👩‍💻 Usage Questions GitHub Discussions
🗯 General Discussion GitHub Discussions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memium-0.25.3.tar.gz (143.8 kB view details)

Uploaded Source

Built Distribution

memium-0.25.3-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file memium-0.25.3.tar.gz.

File metadata

  • Download URL: memium-0.25.3.tar.gz
  • Upload date:
  • Size: 143.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for memium-0.25.3.tar.gz
Algorithm Hash digest
SHA256 31d1f22b1e5da6761a10390ddbf7314b7f57cb0fe27e6380f191d3b79dad4f02
MD5 bdf118c88357ee08251e86a34274b2ad
BLAKE2b-256 39f9c57ea5ad98bcec9d7ad04849f4f336062f2a0e24ca70b6561d20c95147fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for memium-0.25.3.tar.gz:

Publisher: release.yml on MartinBernstorff/Memium

Attestations:

File details

Details for the file memium-0.25.3-py3-none-any.whl.

File metadata

  • Download URL: memium-0.25.3-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for memium-0.25.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0a94f8c78345262d9ee96084c8dc5d3f858888cd83853e0ca74e805b9313b56
MD5 15a405ced18712493fd585676e47b57b
BLAKE2b-256 c903f7515ba6288ceb42d0e5698db3f4b92e2b90b04bb7c03d767fa6ccfeed14

See more details on using hashes here.

Provenance

The following attestation bundles were made for memium-0.25.3-py3-none-any.whl:

Publisher: release.yml on MartinBernstorff/Memium

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page