84 lines
2.5 KiB
Python
84 lines
2.5 KiB
Python
# %%
|
|
from azure.storage.blob import BlobServiceClient
|
|
from azure.core.exceptions import AzureError
|
|
import zipfile
|
|
import os
|
|
|
|
|
|
category_dict = {
|
|
"zip": "CheckerCalls",
|
|
"txt": "Matchups",
|
|
"json": "Checkers",
|
|
}
|
|
|
|
# %%
|
|
|
|
container_name = "ucl"
|
|
season = "UCL 2024/25"
|
|
|
|
|
|
blobEndpoint = "https://aedrawappprd.blob.core.windows.net/"
|
|
sas_token = "sv=2022-11-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2027-08-30T23:13:30Z&st=2024-07-31T15:13:30Z&spr=https&sig=zwvSe6mt%2FdKLSoKK1oPUTBhXroukhUIwtSQod3h6oHk%3D"
|
|
blob_service_client = BlobServiceClient(account_url=blobEndpoint, credential=sas_token)
|
|
container_client = blob_service_client.get_container_client(container=container_name)
|
|
|
|
|
|
# files = os.listdir("uefa_blob")
|
|
|
|
# for file in files:
|
|
# extension = file.split(".")[-1]
|
|
# category = category_dict[extension]
|
|
# tags = {
|
|
# "uploader": "Asolvo",
|
|
# "competition": container_name,
|
|
# "season": season,
|
|
# "category": category,
|
|
# "draw": "Rehearsal",
|
|
# }
|
|
# filename = f"uefa_blob/{file}"
|
|
# with open(file=filename, mode="rb") as data:
|
|
# try :
|
|
# blob_client = container_client.upload_blob(name=file, data=data, tags=tags)
|
|
# print("Upload succeeded", file)
|
|
# except AzureError as az_error :
|
|
# print(f'Error message: {az_error.message}')
|
|
|
|
|
|
# filename = 'test.txt'
|
|
# fileName = 'foobar'
|
|
|
|
|
|
|
|
# container_client.delete_blob(blob="test.txt")
|
|
# %%
|
|
for name in container_client.list_blob_names():
|
|
if "asolvo_draw_simulation_checker" in name and "20240829" in name:
|
|
print(name)
|
|
|
|
# for key,val in container_client.get_blob_client(blob=name).get_blob_tags().items():
|
|
# print(f'\t{key} : {val}')
|
|
# %%
|
|
# %%
|
|
# %%
|
|
|
|
import requests
|
|
import json
|
|
|
|
# url = f'https://aedrawapp-appservice-we-prd.azurewebsites.net/uefa/club_competitions/draws'
|
|
# headers = { "Content-Type": "application/json", "Authorization": "9ec57d80ec0087b6fb8045b78b4556f91453de43392670597acc221a19c0efd0"}
|
|
|
|
# todo = ({ "simNumber": 1, "team_to_check": "Test", "pos": 1, "games" : [ {"home":1, "away":2 }], "feasible":True, "comment":""})
|
|
# checkerCompareTodos = [todo]
|
|
# j=0
|
|
# theseCalls=[ { 'season': "UCL 2024/25", "pots" : [1,2,3,4] ,'games': ch['games'], "checkid" : 100*j+i} for i,ch in enumerate(checkerCompareTodos[j*100:j*100+100])]
|
|
# r = requests.post(f'{url}/checker/', headers=headers, data=json.dumps(theseCalls) , verify=False, timeout=1000)
|
|
|
|
# # %%
|
|
|
|
# r.text
|
|
|
|
|
|
# %%
|
|
|
|
# %%
|