Spaces:
Running
Running
| from __future__ import annotations | |
| import argparse | |
| import sys | |
| from datetime import date | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from nifty_backend.runtime import refresh_first5_prediction | |
| def parse_args() -> argparse.Namespace: | |
| parser = argparse.ArgumentParser(description="Fetch Yahoo Finance first five NIFTY minutes and refresh prediction.") | |
| parser.add_argument("--date", default=None, help="Optional IST session date, YYYY-MM-DD.") | |
| return parser.parse_args() | |
| def main() -> None: | |
| args = parse_args() | |
| session_date = date.fromisoformat(args.date) if args.date else None | |
| prediction = refresh_first5_prediction(session_date=session_date) | |
| print(prediction.to_dict()) | |
| if __name__ == "__main__": | |
| main() | |