Workflow-App/Workflow/scripts/_schema_check.py

16 lines
623 B
Python
Raw Normal View History

import os, requests, pathlib, json
for line in pathlib.Path(r'C:\Users\SJ\.minimax-agent\projects\Workflow\.env.local').read_text().splitlines():
if line.strip() and '=' in line and not line.startswith('#'):
k, v = line.split('=', 1)
os.environ.setdefault(k.strip(), v.strip())
token = os.environ['PB_TOKEN']
h = {'Authorization': f'Bearer {token}'}
r = requests.get(
'https://pb.agent.apphub.co.za/api/collections/pbc_2178038841',
headers=h, timeout=15,
)
r.raise_for_status()
coll = r.json()
print('Schema for ysterbaard_SARS_EMP201_PAYE:')
print(json.dumps(coll.get('schema', []), indent=2))