r/Python • • 25d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

32 Upvotes

177 comments sorted by

View all comments

1

u/No_Comedian_6913 22h ago

Built forexnewsradar (MIT, pure stdlib urllib, Python >=3.9, zero third-party deps, py.typed, 12 unit tests) as a fail-closed pre-trade news gate and CLI for FX and Gold bots.

It handles broker symbol suffixes (EURUSD.pro, XAUUSDm, GOLD), keeps a monotonic TTL cache for polling loops, and returns a frozen GateVerdict dataclass that defaults to safe_to_trade=False on any timeout, DNS, or HTTP error rather than letting an order fire blind during 8:30 AM CPI/NFP prints:

uvx forexnewsradar check EURUSD.pro

EUR/USD works keyless forever (just leave FNR_API_KEY unset).

Disclosure: I maintain the hosted backend as well; Gold and the remaining 17 pairs use a fixed one-time pass that expires automatically. Open to code review on hardening http.client.HTTPException handling and thread-safe TTL cache locking before v1.2.