15 lines
387 B
Python
15 lines
387 B
Python
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
|