@@ -454,6 +454,7 @@ def main():
454454 parser .add_argument ("--file" , type = str , help = "Local dump file path (default: stream from web)" )
455455 parser .add_argument ("--limit" , type = int , help = "Max lines to process (for testing)" )
456456 parser .add_argument ("--dry-run" , action = "store_true" , help = "Count entities without writing files" )
457+ parser .add_argument ("--output" , type = str , help = "Output directory (default: data/json/)" )
457458 args = parser .parse_args ()
458459
459460 players : list [dict ] = []
@@ -576,10 +577,11 @@ def main():
576577 print ("\n Dry run — no files written." )
577578 return
578579
579- OUTPUT_DIR .mkdir (parents = True , exist_ok = True )
580+ out_dir = Path (args .output ) if args .output else OUTPUT_DIR
581+ out_dir .mkdir (parents = True , exist_ok = True )
580582
581583 for name , data in [("players" , players ), ("teams" , teams ), ("coachs" , coaches )]:
582- path = OUTPUT_DIR / f"{ name } .json"
584+ path = out_dir / f"{ name } .json"
583585 with open (path , "w" , encoding = "utf-8" ) as f :
584586 json .dump (data , f , ensure_ascii = False )
585587 print (f"Wrote { len (data ):,} entities to { path } " )
0 commit comments