PERDYPTO
Upload 45 files
0109502 verified
Raw History Blame Contribute Delete
1.43 kB
# Run this once (whenever you sit down to run it - daily, every few days,
# whatever works) to process the NEXT batch of rows. It always resumes from
# wherever the last run left off, so running this once a day for a few weeks
# is exactly the intended usage. It's also fine to interrupt with Ctrl+C -
# see README "Stopping and recovering" section.
#
# Usage:
# scripts\run_daily.ps1 # dry run, 500 rows (safe default)
# scripts\run_daily.ps1 -Real # real run (spends NIM API requests), 500 rows
# scripts\run_daily.ps1 -Real -Limit 200 # real run, 200 rows this session
param(
[switch]$Real,
[int]$Limit = 500
)
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectDir = Split-Path -Parent $ScriptDir
Set-Location $ProjectDir
if (-not (Test-Path ".venv")) {
Write-Host "No .venv\ found - run scripts\setup.ps1 first."
exit 1
}
& .\.venv\Scripts\Activate.ps1
# Keep dependencies in sync with requirements.txt automatically. Fast when
# already installed; never touches anything outside .venv\.
pip install --quiet -r requirements.txt
Write-Host "Running: python main.py --limit $Limit $(if (-not $Real) {'--dry-run'})"
Write-Host "(Ctrl+C once = finish current record, save progress, stop cleanly.)"
Write-Host ""
if ($Real) {
python main.py --limit $Limit
} else {
python main.py --limit $Limit --dry-run
}