Initial test commit

This commit is contained in:
Alexey Barabanov
2025-08-11 13:38:20 +03:00
parent d85ae1316a
commit 3e670d3722
9 changed files with 4459 additions and 0 deletions

33
test_xls.py Normal file
View File

@@ -0,0 +1,33 @@
import pandas as pd
import re
from xlrd import open_workbook
INFILE='Анонсы_Старт.xls'
INFILE='Анонсы_Триумф.xls'
with open_workbook(INFILE) as wb:
chanel=wb[0][0,2].value
df=pd.read_excel(INFILE,header=1)
for i,row in df.iterrows():
title=row.at['Title']
title=re.sub(r'\(.+?\)','',title)
m=re.match(r'(?:Прямой эфир.)?\s*([^\.]+)\.\s*(.+)\.\s*([^\.]+?)\s*-\s*([^\.]+?)\s*\.',title)
if m:
#print(title)
sport,league,team_a,team_b = m.groups()
r={'date':row.at['Date'],'time':row.at['Start Time'],
'chanel':'START' if chanel=='Старт' else 'TRIUMPH',
'sport':sport,'league':league,
'team_a':team_a,'team_b':team_b}
print(r)
else:
print(title)