This project monitors financial disclosures for U.S. House members, tracks stock trades, and provides notifications with detailed trade information. It can analyze PDF disclosures using AI-powered content extraction.
This Python application monitors financial disclosures for U.S. House members, tracks stock trades, and provides notifications with detailed trade information. It can analyze PDF disclosures using AI-powered content extraction to provide comprehensive trade details.
- Automated Disclosure Monitoring: Downloads and processes financial disclosure data from the House Clerk's website
- Targeted Member Tracking: Monitors specific House members (configurable via environment variables)
- Trade Analysis: Extracts and formats stock trade information from PDF disclosures
- Email Notifications: Sends detailed email notifications for new trades
- AI-Powered PDF Analysis: Uses OpenRouter API to extract and format trade information from PDF documents
- Persistent Tracking: Maintains a record of processed trades to avoid duplicate notifications
- Python 3.x
- Required Python packages listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/yourusername/house-member-trades-notifier.git cd house-member-trades-notifier -
Create a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.envfile in the project directory with the following variables:# Email Configuration SENDER_EMAIL=your_email@example.com SENDER_NAME=Your Name APP_PASSWORD=your_app_password RECIPIENT_EMAIL=recipient1@example.com,recipient2@example.com EMAIL_SERVER=smtp.example.com EMAIL_PORT=465 # Monitoring Configuration TARGET_MEMBERS=Pelosi,McCarthy,Schumer TIMEFRAME_DAYS=60 # AI Configuration OPENROUTER_API_KEY=your_openrouter_api_key AI_MODEL=mistralai/mistral-small-3.2-24b-instruct:free PDF_EXRACTOR=True # Storage Configuration PROCESSED_TRADES_FILE=processed_trades.txt
-
Ensure your
.gitignorefile includes the.envfile to avoid pushing sensitive information to GitHub:.env .venv/ __pycache__/ *.pyc
-
For Docker deployment, create a
.envfile with the same variables and mount it as a volume.
-
Run the script:
python nancy.py
-
The script will:
- Continuously check for new financial disclosures
- Monitor trades for the specified House members
- Extract trade information from PDF documents
- Send email notifications for new trades
-
To stop the script, use Ctrl+C in the terminal.
-
Build the Docker image:
docker build -t house-member-trades-notifier . -
Run the container:
docker run -d --name trades-notifier \ -v $(pwd)/.env:/app/.env \ -v $(pwd)/processed_trades.txt:/app/processed_trades.txt \ house-member-trades-notifier
-
Install development dependencies:
pip install -r requirements-dev.txt
-
Run tests:
pytest
-
Run with debug logging:
python -m debug nancy.py
This project is licensed under the MIT License - see the LICENSE file for details.

