You've already forked etude_lego_jurassic_world
Premiers éléments de l'étude
This commit is contained in:
22
scripts/compute_parts_stats.py
Normal file
22
scripts/compute_parts_stats.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Calcule des statistiques simples sur les pièces filtrées."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from lib.rebrickable.parts_stats import read_rows, build_stats, write_parts_stats
|
||||
|
||||
|
||||
PARTS_PATH = Path("data/intermediate/parts_filtered.csv")
|
||||
SETS_PATH = Path("data/intermediate/sets_enriched.csv")
|
||||
STATS_PATH = Path("data/final/stats.csv")
|
||||
DESTINATION_PATH = Path("data/final/parts_stats.csv")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Charge les pièces filtrées et écrit les statistiques associées."""
|
||||
rows = read_rows(PARTS_PATH)
|
||||
stats = build_stats(rows, SETS_PATH, PARTS_PATH, STATS_PATH)
|
||||
write_parts_stats(DESTINATION_PATH, stats)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user