15 lines
799 B
Python
15 lines
799 B
Python
|
|
import os, requests, pathlib
|
||
|
|
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/ysterbaard_companies/records',
|
||
|
|
headers=h, params={'filter': 'enterprise_name~"Deems"', 'perPage': 5}, timeout=15,
|
||
|
|
)
|
||
|
|
r.raise_for_status()
|
||
|
|
for it in r.json()['items']:
|
||
|
|
print(f"id={it.get('id')} name={it.get('enterprise_name')!r} user={(it.get('sars_login_username') or '')!r} pwd_set={bool(it.get('sars_login_password'))} paye={it.get('sars_paye_no')!r}")
|