America's 250th civics fair — naturalization test, pavilion quizzes, offline Python TUI and CLI.
Project description
Civics Check
America's 250th civics fair — offline quizzes, pavilion browsing, and the USCIS naturalization test bank. Pure Python; no accounts, no network required after install.
Runs on its own. You do not need the SAFE App Store monorepo — copy this directory anywhere, or install with pip.
Install (standalone)
From this directory (apps/civics-check in the monorepo, or a copy of that folder):
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
civics-check # console script → app.py
Or use the launcher (creates ~/.willow/apps/civics-check/.venv automatically):
./dev.sh # fair TUI (default)
./dev.sh --cli # stdlib fair map only
Run (standalone)
| What | Command |
|---|---|
| Primary entry | python3 app.py — SAFE manifest entry_point; launches Textual fair when installed, else CLI fair map |
| CLI fair only | python3 app.py --cli |
| TUI directly | python3 tui.py |
| After pip install | civics-check (same as python3 app.py) |
Rebuild catalog after editing sources:
python3 scripts/build_catalog.py
Monorepo (optional)
If you have the full safe-app-store checkout:
make install app=civics-check
make run app=civics-check # runs app.py in apps/civics-check
What you get
- Fair map — parchment lanes (Citizenship Court, Statehouse Row, Founders Hall, …) with pavilion tents
- Naturalization quiz — 10 questions, 6 of 10 to pass (same rule as USCIS civics)
- Speed round — 60 seconds against the full bank
- State matchups — capitals and admission order
- Timeline sort, quote match, colonies flashcards, amendment explorer, and more
- Local progress — missed-question tracking and scores in
civics_check.db(dev tree) or~/.willow/apps/civics-check/(pip install)
Keyboard (TUI)
| Key | Action |
|---|---|
↑ / ↓ or j / k |
Move between lanes / pavilions |
Enter |
Open selected pavilion |
Type answer + Enter |
Submit |
Esc |
Back to fair map |
q |
Quit |
1776 |
Liberty Bell commentary |
Data workflow
Never hand-edit data/catalog.json. It is compiled output.
- Edit JSON under
data/sources/(questions, presidents, numbers, links, fair schedule, …) - Rebuild:
python3 scripts/build_catalog.py - Test:
python3 -m unittest discover -s tests -v
Project layout
app.py Primary entry (SAFE) — TUI when Textual present, else fair CLI
tui.py Textual fair map + stage (optional direct launch)
tui_art.py Hero band, curtains, ASCII ceremony
engine.py Catalog facade shared by CLI and TUI
bell.py Liberty Bell narrator + Joan Stark banner art
db.py Local SQLite scores / missed questions
civics/
catalog.py Load compiled catalog
paths.py Resolve app root + data/ (dev, editable, wheel)
scoring.py Answer matching
session.py Activity state machine
scripts/
build_catalog.py Compile sources → catalog.json
data/
sources/ Authoritative JSON (edit these)
catalog.json Generated — do not edit
tests/
dev.sh Standalone launcher (venv + catalog + run)
pyproject.toml pip install -e . / civics-check console script
safe-app-manifest.json
SAFE manifest
Registered as civics-check in the SAFE App Store monorepo (entry_point: app.py). Permissions: file_write for local SQLite only.
License
MIT — see LICENSE.
ΔΣ=42
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safe_app_civics_check-0.1.0.tar.gz.
File metadata
- Download URL: safe_app_civics_check-0.1.0.tar.gz
- Upload date:
- Size: 239.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fb8e8db2ec74c687f7a74bb01444a516d63e7cf121b539c0c3541c19e2bb553
|
|
| MD5 |
dc2281f3e224eeffeb42c62079f2837d
|
|
| BLAKE2b-256 |
95ca23849748f420030504ed754964cc843903d69f3f7bc29154f9f79ad4b65a
|
File details
Details for the file safe_app_civics_check-0.1.0-py3-none-any.whl.
File metadata
- Download URL: safe_app_civics_check-0.1.0-py3-none-any.whl
- Upload date:
- Size: 144.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdc7ef1342e2146b992e0705950c72513b07e21463ba0dc85afa5a45e70205cc
|
|
| MD5 |
cbf015ed0e88f0423a4c35ccdebb68e9
|
|
| BLAKE2b-256 |
561e5979cacef205c9f98bf743cc672ad3c2b37ae537be969bb63006425b9f8c
|