The Stdlib Ledger That Stops a Re-Run From Double-Posting Uploads
Описание и применение
Скрипт‑лидер, использующий только стандартную библиотеку Python, хранит информацию о завершённых загрузках, предотвращая дублирование и обеспечивая безопасность повторных запусков.
Задача
Re-running an upload script can cause duplicate uploads, leading to spam flags and wasted time.
Результат
The ledger prevented any double‑posting, eliminated spam flags, and provided auditability without adding dependencies.
Рабочий процесс
- Run upload_tracker.py pending items.txt to list unfinished items
- Run upload_tracker.py done "asset-001.jpg" after each successful upload
- Run upload_tracker.py status to audit completed uploads
- Modify batch script to query ledger for pending items before uploading
Доказательства
I nearly lost an upload account to a rerun. My batch script had already pushed 200 files to a stock site.
The fix was not a smarter uploader. It was a ledger.
upload_tracker.py is about 40 lines of standard library Python, and it does one thing: it remembers what you have already posted.
Once the tracker exists, the workflow changes shape. You do not run a batch from your asset folder. You run it from pending.
That gives you three guarantees for free: Rerun safety, Resumability, Auditability.
- Дата записи: 2026-10-24T14:41:16.582Z