recto
A terminal app, in the spirit of Anki, to learn things by heart with flashcards.
A deck holds only question/answer pairs. When it is imported, a model writes variants of every card: the question asked the other way round when that makes sense, and a few rephrasings. Each review asks one variant at random, so you learn the knowledge, not one wording. You type the answer, the model scores it and says what was missing, and FSRS decides when the card comes back.
Install
uv tool install recto
Each tagged version is published on PyPI and has its wheel attached to a GitHub release.
Use
export OPENAI_API_KEY=...
recto
Press i to import a deck: one of the five examples (Anglais, Géographie, Vins, Maths, Histoire de France, 50 cards each) or your own TOML file. Then pick a deck and press enter to review, or c to browse its cards: pick one to see its variants, where you can add, edit, delete or generate more.
Each deck brings 10 new cards a day. Once they and the day's reviews are done, recto offers to learn 10 more, as many times as you like, to get through a deck faster.
| Variable | Default | |
|---|---|---|
OPENAI_API_KEY |
Required: recto won't start without it | |
RECTO_MODEL |
gpt-5.4-mini |
Any OpenAI model name |
RECTO_DB |
the user data directory | Where reviews and variants are kept |
Write a deck
[deck]
name = "Vins"
description = "Cépages, appellations et régions viticoles françaises"
instructions = "Sois exigeant sur les appellations, tolérant sur l'orthographe des cépages."
[[cards]]
id = "chablis-cepage"
question = "Quel cépage domine les vins blancs de Chablis ?"
answer = "Chardonnay"
The file name is the deck id: importing vins.toml again updates the same deck. instructions is optional and is given to the model when it writes variants and grades answers. Each card needs an id, unique in the deck. Fixing a typo in a question keeps the card's history and regenerates its variants; changing its id starts it over. Cards removed from the file are removed from the deck.
How the code is organized
src/recto/
domain/ cards, variants, grades, FSRS memory, today's cards, what a re-import changes
ports/ what the app needs from outside: a deck repository, a variant generator, an answer judge, a clock
use_cases/ one class per action: import a deck, list decks, next card, submit an answer, manage variants
adapters/ SQLite, PydanticAI, the TOML deck files, the system clock, an in-memory repository
tui/ Textual screens, calling use cases only
decks/ the four example decks
container.py the one place where adapters are plugged into ports
Develop
make install
cp .example.env .env # then put your OpenAI key in .env, which git ignores
make run
make check
make help lists the other targets. Tests use fakes, never mocks: use cases run on an in-memory repository, a fake generator, a fake judge and a fixed clock, and the TUI tests drive the real app headless through Textual's Pilot. The SQLite repository is tested against a real database file.
Release
Every push builds the wheel in CI. Once the checks pass on main, a version in pyproject.toml that has no GitHub release yet is published on PyPI, through trusted publishing, and as a GitHub release tagged v<version>. Releasing is bumping the version:
uv version --bump minor
git commit -am "chore(release): 0.2.0"
git push origin main
Metadata
Release files for recto 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| recto-0.4.0.tar.gz | 29.9 kB | Without provenance | Details for recto-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| recto-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for recto-0.4.0-py3-none-any.whl |
Total release size: 71.5 kB
Release files / recto-0.4.0.tar.gz
| Download URL | recto-0.4.0.tar.gz |
|---|---|
| Size | 29.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8190c3772b199e599d68573ca1f01f4a234cb9585417409b62c2e8a436047581
|
|
BLAKE2b-256 checksum How to use checksums |
68554b7cf174ea129fd169636626cefc286d31cca0266098c1e41fa3c743e0bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / recto-0.4.0-py3-none-any.whl
| Download URL | recto-0.4.0-py3-none-any.whl |
|---|---|
| Size | 41.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b932238a97f4e2c53bda5e79a226a316b24fbd3af6530696e728bebbbb0e95e5
|
|
BLAKE2b-256 checksum How to use checksums |
99cd25e3f46495cfe33a30b2be77130c3b5f2766ab0952366d5a231833fb5ba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for recto 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.