#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from collections import Counter
D = "/data/www/files"
ps = json.load(open(D + "/final_projects_20260917.json", encoding="utf-8"))
print("n=%d" % len(ps))
print("province:", dict(Counter(p["province"] for p in ps)))
print("level:", dict(Counter(p["match_level"] for p in ps)))
print("status:", dict(Counter(p["status"] for p in ps)))
print("type:", dict(Counter(p["info_type"] for p in ps)))
b = sum(p["budget"] for p in ps if isinstance(p["budget"], (int, float)))
print("budget total = %.2f 万元" % b)
print()
for p in sorted(ps, key=lambda x: -x["match"]):
    print("%3d %-2s %-6s %-5s %8s %-34s" % (
        p["match"], p["match_level"], p["province"], p["status"],
        p["budget"] if p["budget"] != "未披露" else "未披露", p["title"][:34]))
