chore: release v1.3.0 - 京东账单支持

This commit is contained in:
CHE LIANG ZHAO
2026-01-26 15:36:05 +08:00
parent b654265d96
commit f537b53ebd
5 changed files with 192 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
"""分析京东账单数据"""
import json
import sys
sys.stdout.reconfigure(encoding='utf-8')
with open('../jd_bills.json', 'r', encoding='utf-8') as f:
d = json.load(f)
bills = [b for b in d['data']['bills'] if b['bill_type'] == 'jd']
print(f'Total JD bills: {len(bills)}')
print()
# Review level distribution
review_levels = {}
for b in bills:
lvl = b['review_level'] or 'NONE'
review_levels[lvl] = review_levels.get(lvl, 0) + 1
print('Review level distribution:')
for lvl, cnt in sorted(review_levels.items()):
print(f' {lvl}: {cnt}')
print()
# Category distribution
categories = {}
for b in bills:
cat = b['category']
categories[cat] = categories.get(cat, 0) + 1
print('Category distribution:')
for cat, cnt in sorted(categories.items(), key=lambda x: -x[1]):
print(f' {cat}: {cnt}')
print()
# Show bills that need review
print('Bills needing review:')
print(f"{'Level':<5} | {'Category':<12} | {'Merchant':<20} | Description")
print('-' * 70)
for b in bills:
if b['review_level']:
print(f"{b['review_level']:<5} | {b['category']:<12} | {b['merchant'][:20]:<20} | {b['description'][:30]}")