chore(auto): 2026-10-26T16:37:00Z — items=5594 typed=5594 sources=665 priced=224 runs=120 problems=OK
This commit is contained in:
25
tools/_readme_stats.py
Normal file
25
tools/_readme_stats.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import collections
|
||||
import sqlite3
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
from omni import sources, taxonomy # noqa: E402
|
||||
|
||||
src = sources.all_sources()
|
||||
by_cat = collections.Counter(s.category for s in src)
|
||||
con = sqlite3.connect("data/" + "omni.sqlite3")
|
||||
items = con.execute("select count(*) from items").fetchone()[0]
|
||||
priced = con.execute("select count(*) from items where price is not null and price>0").fetchone()[0]
|
||||
runs = con.execute("select count(*) from runs").fetchone()[0]
|
||||
xn = con.execute("select count(*) from items where provider='x'").fetchone()[0]
|
||||
flat = collections.Counter()
|
||||
for combo, n in con.execute("select types,count(*) from items where types!='' group by 1"):
|
||||
for t in str(combo).split(","):
|
||||
if t.strip():
|
||||
flat[t.strip()] += n
|
||||
print(f"sources={len(src)} items={items} priced={priced} runs={runs} x={xn}")
|
||||
print(" · ".join(f"{taxonomy.LABELS.get(k, k)} {v}" for k, v in flat.most_common()))
|
||||
open("data/_cats.md", "w", encoding="utf-8").write(
|
||||
"\n".join(f"| `{c}` | {n} |" for c, n in by_cat.most_common()))
|
||||
open("data/_types.md", "w", encoding="utf-8").write(
|
||||
" · ".join(f"{taxonomy.LABELS.get(k, k)} {v}" for k, v in flat.most_common()))
|
||||
Reference in New Issue
Block a user