From b95b2db4a978e262ef8c20df8eecc9624b20e742 Mon Sep 17 00:00:00 2001 From: "Thomas (Tom) C. Gorordo" Date: Mon, 25 May 2026 18:38:04 -0700 Subject: [PATCH] start of cli --- src/carouselcmd.py | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/carouselcmd.py b/src/carouselcmd.py index caac855..1ae15b8 100644 --- a/src/carouselcmd.py +++ b/src/carouselcmd.py @@ -1,10 +1,44 @@ +# /// script +# requires-python = ">=3.13" +# dependencies = [ +# "click>=8.4.1", +# "rich>=15.0.0", +# "polars>=1.40.1", +# "rustworkx>=0.17.1" +# ] +# /// +import sys, io import click -import carousel + +from rich.console import Console +from rich.table import Table +from rich.panel import Panel + +import polars as pl +from carousel import match_from_prefs @click.command() -def cli(): - carousel.main() +@click.argument("preferences", type=click.Path(exists=True, dir_okay=False)) +@click.option( + "--show-preferences", + "-b", + is_flag=True, + help="Show relevant preferences (after selections).", +) +@click.option("--pretty", "-p", is_flag=True, help="Pretty-print output.") +def cli(preferences: str, show_ballots=False, pretty=False) -> None: + """ + Compute the Gale-Shapley stable match of some preferences -- .csv or .xls(x). + + A stable matching (of the "college admissions" problem) is one in which there is no + pair of, say, TA and course which would prefer each other over their respective + assignment given by the matching. + """ + + console = Console() + + pass if __name__ == "__main__":