New Features:
- Watchlist system for tracking specific Congress members
- Trading report generation with multiple formats
- Pre-market-close automated updates (3 PM)
New Scripts:
- scripts/fetch_congress_members.py: Manage watchlist
* 29 known active traders (curated list)
* Optional ProPublica API integration (all 535 members)
* Create/view/manage watchlist
- scripts/generate_trading_report.py: Generate trading reports
* Filter by watchlist or show all
* Multiple formats: text, HTML, JSON
* Summary statistics (buys/sells, top tickers)
* Color-coded output (🟢 BUY, 🔴 SELL)
- scripts/pre_market_close_update.sh: 3 PM automation
* Quick fetch of latest trades
* Enrichment of new securities
* Generate and display report
* Saves to reports/ directory
Documentation:
- WATCHLIST_GUIDE.md: Complete guide
* List of 29 known active traders
* How to create/customize watchlist
* Schedule options (pre-market, post-market)
* Email setup (optional)
* FAQ and examples
Known Active Traders Include:
Senate: Tuberville, Rand Paul, Mark Warner, Rick Scott
House: Pelosi, Crenshaw, MTG, Gottheimer, Brian Higgins
Use Cases:
✅ Daily reports at 3 PM (1 hour before close)
✅ See what Congress bought/sold recently
✅ Track specific members you care about
✅ Export to HTML/JSON for further analysis
Critical Fixes:
- Fixed Price model query to use security_id join with Security
- Added Security import to returns.py module
- Fixed all test fixtures to use test_db_session correctly
- Added AAPL price data to sample_prices fixture
New Tests:
- tests/test_analytics_integration.py: 10 comprehensive integration tests
* Real-world scenarios with synthetic price data
* Return calculations, benchmark comparisons, performance metrics
* Edge cases: missing data, sell trades, disclosure timing
Documentation:
- LOCAL_TEST_GUIDE.md: Complete guide for local testing
* How to test before deploying
* Current data status (live vs fixtures)
* Multiple options for getting real data
* Common issues and fixes
Test Results:
✅ All 55 tests passing
✅ Analytics fully functional
✅ Ready for deployment
Live Data Status:
❌ House Stock Watcher API still down (external issue)
✅ Manual CSV import works
✅ yfinance for prices works
✅ Can use system NOW with manual data
- Replace 'sudo -u' with 'su -' throughout the script
- Works perfectly in LXC containers running as root (no sudo installed)
- Also works on regular VMs/servers where sudo is available
- Fixes all remaining: sudo: command not found errors