29 lines
641 B
Python
29 lines
641 B
Python
from pathlib import Path
|
|
|
|
import click
|
|
|
|
import enrich_giant
|
|
|
|
|
|
@click.command()
|
|
@click.option(
|
|
"--input-dir",
|
|
default="data/giant-web/raw",
|
|
show_default=True,
|
|
help="Directory containing Giant raw order json files.",
|
|
)
|
|
@click.option(
|
|
"--output-csv",
|
|
default="data/giant-web/normalized_items.csv",
|
|
show_default=True,
|
|
help="CSV path for normalized Giant item rows.",
|
|
)
|
|
def main(input_dir, output_csv):
|
|
rows = enrich_giant.build_items_enriched(Path(input_dir))
|
|
enrich_giant.write_csv(Path(output_csv), rows)
|
|
click.echo(f"wrote {len(rows)} rows to {output_csv}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|