Spaces:
Sleeping
Sleeping
File size: 816 Bytes
e82864c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# src/generate_flashcard_viewer.py
"""
Utility script to generate a standalone HTML viewer for a given
user's flashcard deck. Typically, the Streamlit app calls
app.viewers.generate_flashcard_viewer_for_user directly.
"""
import argparse
from pathlib import Path
from app.viewers import generate_flashcard_viewer_for_user
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--user", required=True, help="Username")
parser.add_argument("--deck", required=True, help="Path to deck JSON")
args = parser.parse_args()
deck_path = Path(args.deck)
if not deck_path.exists():
raise FileNotFoundError(deck_path)
out_path = generate_flashcard_viewer_for_user(args.user, deck_path)
print(f"Viewer written to: {out_path}")
if __name__ == "__main__":
main()
|