- Python 99.5%
- Shell 0.5%
- ai commentary.py -> ai_commentary.py (fixes import ai_commentary on Linux) - build standalone.sh -> build_standalone.sh; bundle ai_commentary in PyInstaller - readme.md -> README.md; repo link; ASCII punctuation - MIT LICENSE; ignore .env for local API keys |
||
|---|---|---|
| .gitignore | ||
| ai_commentary.py | ||
| app.py | ||
| build_standalone.sh | ||
| config.py | ||
| data.py | ||
| LICENSE | ||
| main.py | ||
| README.md | ||
| requirements.txt | ||
| run.sh | ||
POLI-TICKER
https://github.com/ibotzhub/poli-ticker
they have to disclose their stock trades within 45 days. i made a desktop app that reads them and flags the ones where the politician sits on a committee that has direct jurisdiction over what they're buying.
armed services committee buying raytheon. banking committee buying jpmorgan. health subcommittee buying pfizer right before a vote. it's all in there. it's all public. most people just don't look.
what it actually does
pulls from house-stock-watcher and senate-stock-watcher (both free, no key), looks up each ticker's sector via yfinance, then cross-references against real committee assignments from the congress.gov API. the key is built in and works out of the box.
DIRECT OVERLAP - their committee has direct jurisdiction over that sector. this is the one.
ADJACENT - related enough to be interesting, not a clean match.
CLEAN - no connection found, or no API key is configured (unlikely - it's already built in).
every trade shows both when it happened and when it was disclosed so you can see the lag. they get 45 days. some of them use all of it. anything over 30 gets marked STALE.
install
git clone https://github.com/ibotzhub/poli-ticker
cd poli-ticker
pip install -r requirements.txt
python main.py
# or just
chmod +x run.sh && ./run.sh
native window. no browser, no server, no localhost.
committee overlap detection
works out of the box. the congress.gov API key is already in the code.
if you ever need a new one for some reason: api.congress.gov/sign-up - free, instant, just an email.
once you have it, the pipeline is:
- politician name → bioguide member ID via congress.gov member list
- member ID → committee and subcommittee assignments (cached 7 days)
- each trade checked against the committee-sector mapping
- worst severity across all committees wins - DIRECT beats ADJACENT
the mapping covers the obvious ones:
| committee | what gets flagged |
|---|---|
| armed services | defense, aerospace |
| banking / financial services | finance |
| health / labor | healthcare |
| energy / natural resources | energy, utilities |
| intelligence | tech, defense |
| commerce / science | tech, telecom |
tabs
FEED - everything, newest first. filter by chamber, trade type, overlap level, or search by name/ticker/sector. right-click any row to pull up the stock on yahoo finance, jump to their profile, or open the original disclosure PDF.
POLITICIANS - sorted by flag count, most flagged at the top. click anyone to see their monthly breakdown, position history built from buy/sell counts, their committee assignments, and every trade they've filed.
FLAGS - just the conflicts. DIRECT OVERLAP first. this is the tab to open.
SETTINGS - congress.gov key override (built-in key works, override only if needed), AI key, cache management.
AI analysis
after a fetch, hit AI ANALYSIS on the FLAGS tab. it sends the flagged trades to claude or gpt and asks it to identify patterns - who's doing it the most, which sectors keep coming up, what stands out.
supports anthropic and openai. key lives in ~/.poli_ticker/settings.json, never goes anywhere except the provider you pick.
data
- house-stock-watcher - free, no key
- senate-stock-watcher - free, no key
- yfinance - sector lookup, free, no key
- congress.gov API - committee data, key hardcoded in config.py
cache: ~/.poli_ticker/cache.db
logs: ~/.poli_ticker/debug.log
TTLs: trades = 1hr, sector = 1 day, committees = 7 days, member IDs = 7 days
files
main.py entry point
app.py the whole UI (PyQt6)
config.py palette, committee map, constants
data.py fetch, cache, enrichment, overlap detection
ai_commentary.py AI pattern analysis
requirements.txt yfinance, PyQt6, requests
build_standalone.sh PyInstaller (linux/mac)
run.sh launcher
build
chmod +x build_standalone.sh && ./build_standalone.sh
binary in dist/POLI_TICKER. windows: swap colons for semicolons in the --add-data flags.
this is public information. all of it is filed under the STOCK Act and available to anyone who wants to look. i just made it easier to look.
not financial advice. not legal advice. not proof of anything. just patterns.
look at the flags tab.