Skip to main content

Latinitas Cards

CI Python 3.13 | 3.14 License: GPL-3.0-or-later

Latinitas Cards is an offline-first CLI for building Latin Anki study cards from existing decks or reviewed corpus annotations. It supports deck-first principal-part, phrase and form-parsing workflows, and corpus-first exercises with German or English study content. Confirm profiles and annotation claims, preview cards, then export repeatable UTF-8 Anki text-import CSVs without modifying source decks or texts.

This version: 0.4.0. See release readiness and limits for publication status, accepted Linux Anki Desktop evidence and compatibility boundaries. Start with the corpus-first walkthrough or the deck-first quick start.

Workflow

The deck-first workflow reuses your existing vocabulary:

  1. Inspect a CSV, APKG, or COLPKG source and confirm its field mapping.
  2. Save the human-readable, versioned profile and reuse it on later runs.
  3. Preview principal-part completion and recognition cards.
  4. Generate a deterministic CSV with LatinitasID first for repeat imports.
  5. Import the CSV into a prepared Anki note type, then repeat the import with the same note type and first-field matching.

Also available: managed updates for notes you already imported, explanations and themes on principal-part answers, reviewed form-parsing exercises, and reviewed lexical/pattern selections and bounded phrase proposals via phrases, with separately reviewed translation/recognition exercises and offline eligibility checks, deterministic approved CSV export and managed retained-slot updates. Initial creation is manual CSV import plus explicit adoption; withdrawal remains a blocked plan requiring reviewed manual resolution, not CSV omission or automatic retirement.

The corpus-first workflow starts from reviewed Latin passages: normalize Latin text, USFX or a supported TEI edition, import aligned translations, review annotation claims, rank candidates and keep a sticky selection, then preview and export a new corpus CSV. The walkthrough covers all four recipes, English output, deselect/restore and the separate adoption/managed-update boundary. Reference translations guide study, not automatic grading. Initial CSV import can create notes; managed CSV updates cannot create or retire them. See the complete TEI subset and exclusions and agent contract for schemas, diagnostics and reasons. Cards show readable author, work and passage citations, with expandable source details and lossless technical provenance. Verified links are limited to the supported Caesar and Aeneid editions/passages; an online passage link does not establish equality with the pinned source bytes or grant redistribution rights. See the citation and provenance guide and v0.4.0 evidence and limits.

Profiles select recipes explicitly; the approved representative profile uses principal_part_completion and principal_part_recognition. It uses the semantic role perfect_passive_participle (PPP), not the legacy supine role. CLI controls and diagnostics are English; generated study content follows the profile's explicit language_tag (default de): English for primary subtag en, otherwise German.

The profile workflow never mutates the source CSV/APKG/COLPKG. ID-less CSV sources require explicit identity reconciliation decisions on first use or when review items appear; unchanged rows with a valid manifest are reused automatically. See the focused identity contract and CSV/import workflow for ownership, recovery, and Anki setup details.

Installation

Prerequisites: Python 3.13 or 3.14. Linux and macOS are supported; Windows is not supported. The default install needs no CLTK, Stanza or PyTorch.

PyPI installation

Choose one isolated install from PyPI. These commands install the latest published version; check latinitas-cards --version and the release record above when comparing it with this 0.4.0 documentation.

uv tool install latinitas-cards
# Or, with pipx:
pipx install latinitas-cards
# Or, with pip inside an activated virtual environment:
python -m venv .venv
source .venv/bin/activate
pip install latinitas-cards

Upgrade using the same installer (activate the venv first for pip):

uv tool upgrade latinitas-cards
pipx upgrade latinitas-cards
pip install --upgrade latinitas-cards

The bundled Vulgate is not in the wheel or sdist. For corpus workflows, supply your own USFX path and optionally --descriptor FILE for corpus metadata.

Git development checkout

The development checkout remains available with uv. The command below checks out the v0.4.0 release tag once available. To work on the latest development version instead, clone without --branch v0.4.0.

git clone --branch v0.4.0 --depth 1 https://github.com/fmueller/latinitas-cards.git
cd latinitas-cards
uv sync --locked
uv run latinitas-cards --help

Experimental annotation extras

Both annotate and annotate-gpu are experimental; the two extras must not be combined. annotate downloads Stanza models on first run (network and disk space required). For a checkout, the CPU extra installs CLTK 2, Stanza and CPU-only PyTorch:

uv sync --locked --extra annotate

uv's CPU torch index and extra conflict do not transfer to pip. Use this CPU-extra command inside the activated venv on Linux:

pip install 'latinitas-cards[annotate]' --extra-index-url https://download.pytorch.org/whl/cpu

On macOS, PyPI's torch wheels are already CPU-only; use pip install 'latinitas-cards[annotate]'. pip does not enforce uv's extra conflict: choose one extra, never both. The additional index participates in dependency resolution; use only trusted indexes and review the resolved packages.

Quick start

Use the installed CLI and your own Latin APKG, COLPKG or CSV source. Replace the example source path below; the package does not include repository test fixtures. For corpus inputs instead, follow the corpus-first walkthrough linked above.

workdir="$(mktemp -d)"
profile="$workdir/profile.json"
output="$workdir/generated-principal-parts.csv"
source="/path/to/your/latin-deck.apkg"

# Propose, explicitly confirm, and save a reusable profile.
latinitas-cards setup \
  --input "$source" \
  --profile "$profile" \
  --recipe principal_part_completion \
  --recipe principal_part_recognition \
  --non-interactive \
  --confirm \
  --json

# Preview without writing the generated CSV.
latinitas-cards preview \
  --input "$source" \
  --profile "$profile" \
  --limit 2

# Write deterministic UTF-8 Anki text-import CSV. The first export needs
# --approve-fresh-import; later exports reuse the checkpoint state that is
# saved next to the source as <source>.latinitas-cards.json.
latinitas-cards generate \
  --input "$source" \
  --profile "$profile" \
  --output "$output" \
  --approve-fresh-import

For an interactive setup, omit --non-interactive --confirm; review the proposed examples and answer the confirmation prompt. Field suggestions rank sampled content (values matching principal-part forms, single-word shapes) alongside field names, and the proposal shows sample values and the reason for each suggestion. When the evidence ties, conflicts, or is too sparse, setup requires an explicit field choice — pass --lexical-entry-field/--principal-parts-field or answer the interactive choice prompt — before a profile can be saved. Repeat --role in semantic order when correcting a proposal, for example:

latinitas-cards setup \
  --input source.csv \
  --profile .latinitas/profile.json \
  --role present_infinitive \
  --role present_1s \
  --role perfect_1s \
  --role perfect_passive_participle

For the reviewed source layouts, the saved profile's principal_parts section can set pipe_alternatives: true (keep | alternatives within a role) and trailing_poet_hint: true (keep a trailing poet. after the perfect form as a hint). Both are off by default; check representative values before turning them on. Alternatives and hints are kept as source evidence, never guessed into a single answer: unresolved forms are left off the cards and listed in the preview. Zero-card entries are not exported.

Prepare the generated note type, fields, template, and HTML import setting before the first import; the note type keeps a user-owned Personal Notes field that generated CSVs never contain. For repeat imports, use the same note type with LatinitasID as the first/matching field; Personal Notes stays unmapped because no CSV column exists for it. Map a legacy CSV's Personal Notes column to Ignore field on every repeat import. The deterministic CSV export guide has the complete checklist, including native Anki behavior already verified in a disposable collection; retest it there before relying on it.

Collections from earlier pre-release Latinitas models are never silently converted: the legacy transition policy keeps such data read-only, retains collections with valuable history or personal annotations, and offers only an explicitly approved, backed-up fresh start into a new dedicated note type for disposable data.

Treat setup JSON, terminal previews, generated CSVs, and identity manifests as source-derived data: they can contain study text, stable IDs, and provenance. Redact them before sharing an issue or other public report.

Updating imported notes (managed)

managed prepares a reviewed update CSV for notes already in your collection, so their scheduling can be kept under the offline checklist. It never opens Anki's collection backend; capture reads only an explicitly attested closed backup copy. You import the update file in Anki.

Try the complete sequence on a sanitized disposable fixture, without assembling snapshot or baseline JSON by hand (run from this repository):

work=$(mktemp -d)
uv run --with anki==26.9.3 python scripts/check-managed-capture.py \
  --output-dir "$work/evidence"

This runs the installed CLI's capture, adopt, plan, approve, emit, a fixture-only native import, another closed capture, and observe. It writes every request/result plus commands.json and checks full card/history/model/deck tables, personal text and manual tags. It does not verify the Desktop dialog or AnkiMobile.

For your destination, first follow the closed-backup acquisition and adoption guide. Schema-18 protobuf definitions are optional; no Anki runtime is added to the default installation. The selection file records your collection/profile binding and the whole immutable source/object membership; the ownership file records each note's explicitly reviewed tag origins and keep overrides. Neither visible Latin text nor a deck name supplies identity.

uv run --with anki==26.9.3 latinitas-cards managed capture closed-backup.anki2 \
  --selection selection.json --closed-backup --interval-confirmed > snapshot.json
uv run latinitas-cards managed adopt snapshot.json --ownership ownership.json \
  --review 'reviewed each note and its ownership' --state baseline.json
uv run latinitas-cards managed plan request.json > plan.json      # what would change
uv run latinitas-cards managed approve plan.json \
  --operation '<id from plan>' --review 'why this change is OK' > approval.json
uv run latinitas-cards managed emit handoff.json --state baseline.json --output updates.csv
# Import updates.csv in Anki, then record what actually happened:
uv run latinitas-cards managed observe observation.json --state baseline.json --interval-confirmed

Back up first and don't review or sync on any device until the result is recorded. Backup recoverability, snapshot freshness and the edit-free interval are operator attestations: a nonempty backup/hash is not restoration proof, and the tool enforces no snapshot age bound or collection lock. Emission is supported offline handoff, not automated collection application or proof of a successful native import. Only content fields and tags can be updated; adding, retiring, or reactivating cards is not supported. Capture/adoption are not apply approval. Proposals and the plan/handoff/ observation envelopes remain explicit JSON; the runnable fixture demonstrates their construction, and the format and full checklist are in destination snapshots and file transport.

Explanations and themes

Set the look of principal-part answers in the saved profile's morphology section; setup has no flags for it.

"morphology": {
  "version": 1, "theme": "muted", "appearance": "light", "comparison": "static",
  "terminology": {"version": 1, "language": "latin"}
}

theme is muted or monochrome; appearance is light or dark (fixed, not following device night mode); comparison is static (default) or disclosure. setup --reconfigure preserves these saved settings while proposing source mappings again. An explicit morphology object must include "version": 1 and versioned terminology. Explicitly upgrading a legacy profile uses muted/light/static defaults when the whole section was absent. Paste the reference CSS into your note type by hand; see reference note type.

Grammatical terminology

Principal-part answers and contextual form-parsing answers default to Latin terminology. To use the profile's language, add "terminology": {"version": 1, "language": "user"} inside morphology; "language": "latin" selects Latin. user uses the profile's language_tag and supports German (de) and English (en), including regional tags. Unknown settings, unsupported versions and unsupported user languages fail validation. Latin terminology works with any language_tag.

Legacy profiles without terminology are rejected on ordinary load. Explicitly upgrade to Latin defaults with latinitas-cards terminology upgrade old-profile.json new-profile.json; the old file is untouched and existing output files are never overwritten. An explicitly supplied terminology object must include "version": 1. Both preview/generate --profile and form-parsing preview/export accept --terminology latin|user and report the effective setting and override. Form-parsing reports go to stderr so stdout remains JSON.

Controlled feature values (such as nominativus and pluralis) remain canonical in reviewed claims and display as Kasus: Nominativ, Numerus: Plural in German. Values outside the vocabulary still need explicit individual review and display verbatim, never machine-translated. Changing terminology does not change reviewed explanatory prose or translations. Changing terminology preserves claim fingerprints, linguistic reviews, identities and frozen card slots. Changed answer payloads require renewed managed approval, not renewed linguistic review. Separately approved retained-slot updates are available for current principal-part, parsing and phrase layouts. CSV installs no templates or CSS; old layout digests fail closed and need reviewed manual setup, never silent scheduled-template rebinding.

Card language

Fixed card text follows the profile's language_tag. A primary subtag of en (such as en-GB) renders English phrase prompts and answers, principal-part front role labels, comparison and withheld text. Grammatical answer labels follow terminology: English in user mode, Latin in latin mode. Any other tag renders German exactly as before. Latin-first prompts such as Formam resolve. and reviewed free text are never translated. Note IDs, card keys, slots and CSV columns do not change with language.

Write reviewed form translations and phrase references in the card language. Form translations require a profile tag with primary subtag de or en. A phrase reference declares "language": "de" (the default) or "en", and only a reference matching the card language renders; another is withheld even when accepted. The tool trusts the declared language and does not detect it from the text.

Claim fingerprints bind the whole deck profile except morphology, language_tag included. Switching a profile from de to en therefore makes every reviewed claim of that profile stale, not only translations. Archive the old sidecar and review each claim again, with English values, before cards become eligible. Applying the switch to imported notes is a managed retained-slot update with renewed approval.

Experimental and planned capabilities

These remain available for legacy workflows, not release promises:

  • split --output-format apkg: experimental APKG mutation and split-note cloning;
  • cloze and preview/generate --usfx: experimental corpus-based generation; and
  • annotate: experimental CLTK/Stanza analysis, with optional Ollama disambiguation.

Structural parser counts do not establish eligible-verb or universal morphological coverage; full grammatical parsing and live (in-Anki) updates are not implemented. PPP and supine remain distinct semantic roles.

form-parsing offers offline, individually reviewed contextual feature preview and fresh CSV export, not automatic analysis or managed application. Display checks passed only for test notes on Anki Desktop 26.09.2 and AnkiMobile 25.09. See the review policy and separate manual reference setup.

Authored JSONL study notes can be validated, previewed, and exported without corpus resources or profile mappings:

uv run latinitas-cards authored validate notes.jsonl --namespace my-course
uv run latinitas-cards authored preview notes.jsonl --namespace my-course --kind vocab
mkdir -p authored-csv
uv run latinitas-cards authored export notes.jsonl --namespace my-course \
  --output-dir authored-csv --deck 'Latin::Authored'

Validation and preview write nothing; export writes one CSV per selected kind and never changes the input. See the authored import guide for combined filters, whole-file diagnostics, and first/repeat Anki import with Personal Notes unmapped.

For loosely structured Markdown, ask your repository agent to use extracting-authored-notes (also installed under .claude/skills/). Supply notes, language, a stable namespace, and any existing JSONL. Review QA keys and the validated preview before export; re-extraction preserves keys and skip decisions and reports new/changed/missing items.

Documentation

Development and contribution

Set up the pinned development toolchain and local hooks with mise:

mise run setup

Read AGENTS.md for the project structure, coding conventions, test commands, and contribution/commit policy. The required local checks are:

uv run ruff check
uv run mypy
uv run pytest -v

Support

There is no support SLA or live Anki-collection assistance. Report reproducible issues through the GitHub issue tracker with sanitized commands and error output; do not upload private decks or credentials.

License

GPL-3.0-or-later

Metadata

Release files for latinitas-cards 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for latinitas-cards 0.4.0
File Size Uploaded Provenance Actions
latinitas_cards-0.4.0.tar.gz 271.2 kB With provenance Details for latinitas_cards-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for latinitas-cards 0.4.0
File Interpreter ABI Platform Actions
latinitas_cards-0.4.0-py3-none-any.whl Python 3 none any Details for latinitas_cards-0.4.0-py3-none-any.whl

Total release size: 582.9 kB

Release files / latinitas_cards-0.4.0.tar.gz

Download URL latinitas_cards-0.4.0.tar.gz
Size 271.2 kB
Tags Source
SHA-256 checksum
How to use checksums
817c671513e75b7650369ec20af9173d214472e1bf3e6abb98caa39c8caa04de
BLAKE2b-256 checksum
How to use checksums
dd5ed5b48ec7df677a46ca36c06920962085bcecaf506bcc9031ac0c6943f64a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / latinitas_cards-0.4.0-py3-none-any.whl

Download URL latinitas_cards-0.4.0-py3-none-any.whl
Size 311.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b549cf4850b199b79462f95d5090145f2cbecb04d6c2c9ed782953df99692403
BLAKE2b-256 checksum
How to use checksums
cd122b984256fa2d84c1b270fd9542c80b953e173191aef71904d31c0211eef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for latinitas-cards 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for latinitas_cards-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page