Keep a growing record of every draw in the excel sheets

- records.py: merge new draws into each sheet instead of replacing it, so
  history older than what the WV lottery site keeps is not lost. Cash Pop
  rows are matched by draw id (several draws a day share Date+Numbers).
- All scrapers use records.draw_day() for the draw date and merge_save()
  for the sheet; cash pop now keeps its own cash_pop.xlsx.
- Sheets updated with the latest draws, including the backfilled 10/10
  Powerball and Lotto America draws.
- Ignore __pycache__, cron logs, sheet lock files and server-side backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
williedynamiteandClaude Opus 5.5 committed 2026-10-12 07:12:55 -04:00
1 parent f52dd964ad
commit a8698c88d3
16 files changed
+153 -13

No files matched your search

+4 -2
View File
@@ -2,6 +2,7 @@
from fractions import Fraction as frac
from math import comb
import pandas as pd
import records
import requests
from collections import Counter
import csv
@@ -22,7 +23,7 @@ def get_data():
r = requests.get(url + str(page), headers=header)
data = r.json()
for x in data['content']:
web['Date'].append(x['drawingDate'])
web['Date'].append(records.draw_day(x))
web['Numbers'].append('–'.join(str(n['data']) for n in x['resultData'] if n['type'] == 'REGULAR'))
web['PB'].append([n['data'] for n in x['resultData'] if n['type'] == 'SPECIAL'][0])
if data['last']:
@@ -31,7 +32,8 @@ def get_data():
dfs = [pd.DataFrame(web)]
pd.set_option('display.max_rows', None)
# Specifies no max rows, otherwise only shows 10 records
df = pd.concat([dfs[0], salvaged], ignore_index=True)
# Adds any draw not in the sheet yet, so the excel record keeps growing
df = records.merge_save('./excel_lotto_records/lotto.xlsx', dfs[0], fallback=salvaged)
df2 = df[['Date', 'Numbers', 'PB']]
date = list(df2['Date'])
nums = list(df2['Numbers'].astype('str'))