Implemented main basically
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-14 17:41:48 +02:00
parent f8bd18c307
commit 97986d78e5
8 changed files with 152 additions and 44 deletions

View File

@@ -0,0 +1,14 @@
from program_schema import ProgramSchema, SUPPORTED_PROGRAM_STRUCTURE_VERSION
import requests
def load_program(url: str) -> dict:
headers = {
'Accept': 'application/json'
}
r = requests.get(url, headers=headers)
r.raise_for_status()
program_schema = ProgramSchema(many=False)
return program_schema.load(r.json()) # Might raise marshmallow exceptions