15 lines
645 B
Python
15 lines
645 B
Python
|
|
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']
|
||
|
|
r = requests.get(
|
||
|
|
'https://pb.agent.apphub.co.za/api/collections/ysterbaard_SARS_EMP201_PAYE/records',
|
||
|
|
headers={'Authorization': f'Bearer {token}'},
|
||
|
|
params={'filter': 'company_period_key="8g5qcnop9yxafpw:202608"'},
|
||
|
|
timeout=15,
|
||
|
|
)
|
||
|
|
r.raise_for_status()
|
||
|
|
print(json.dumps(r.json()['items'][0], indent=2))
|