import urllib.request, json
url = 'http://192.168.0.61:18000/trial-balance?date_from=2025-06-01&date_to=2025-12-31'
with urllib.request.urlopen(url, timeout=5) as r:
    data = json.loads(r.read())
accounts = data['accounts']
print('全科目コード:', [a.get('account_code') for a in accounts])
print()
for a in accounts:
    code = a.get('account_code', '')
    if code and code >= '800':
        name = a.get('account_name', '')
        debit = a.get('debit', 0) or 0
        credit = a.get('credit', 0) or 0
        print(f'  {code} {name:<15} debit:{debit:>10,.0f} credit:{credit:>10,.0f}')
