File size: 1,019 Bytes
26d7a99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File Objective  : CLI to refresh keyword signals and print the ranked momentum table.
# Scope           : Dev script β€” verify signals.json is written and cache-aside works.
# What it does    : Calls fetch_signals() then prints all keywords sorted by momentum.
# What it does not: Compute coverage or GapScore β€” that is the gap module's job.

from __future__ import annotations

import sys

from vantage_core.adapters.signals_pytrends import fetch_signals


def main() -> None:
    records = fetch_signals()
    if not records:
        print("No signals returned β€” check internet or pytrends rate limit.")
        sys.exit(1)
    print(f"\n── Signals ({len(records)} keywords) ────────────────────────────────────")
    for rec in sorted(records, key=lambda r: r.momentum_percentile, reverse=True):
        print(f"  {rec.momentum_percentile:.4f}  {rec.z_score:+.3f}  {rec.keyword}")
    print()


if __name__ == "__main__":
    main()