mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-05 18:12:14 -07:00
start of cli
This commit is contained in:
parent
c4b42d2baa
commit
b95b2db4a9
1 changed files with 37 additions and 3 deletions
|
|
@ -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 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()
|
@click.command()
|
||||||
def cli():
|
@click.argument("preferences", type=click.Path(exists=True, dir_okay=False))
|
||||||
carousel.main()
|
@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__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue