open-navigator / examples /POLITICAL_FINANCE_QUICK_START.md
jcbowyer's picture
Clean HuggingFace deployment without binary files
61d29fc
# Political Finance Data Integration - Quick Start
## πŸš€ Overview
You now have **3 major data integrations** that work together to reveal political connections in civic engagement:
1. **Grants.gov API** - Federal grant opportunities (FUTURE funding)
2. **FEC Political Contributions** - Campaign donations (POLITICAL connections)
3. **Voter Data** - Political demographics (CONTEXT)
Combined with your existing **IRS Form 990 data** (PAST funding), you have the most comprehensive political-financial tracking system for civic engagement.
## πŸ“Š The Complete Data Ecosystem
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ YOUR COMPLETE DATA ECOSYSTEM β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ EXISTING DATA NEW INTEGRATIONS β”‚
β”‚ ────────────── ──────────────── β”‚
β”‚ β”‚
β”‚ IRS 990 Grants.gov β”‚
β”‚ β€’ 3M+ nonprofits ───> β€’ Federal grant opportunities β”‚
β”‚ β€’ $800k grants β€’ Application deadlines β”‚
β”‚ β€’ Officers β€’ Award amounts β”‚
β”‚ β€’ Financials β€’ Eligibility β”‚
β”‚ β”‚ β”‚
β”‚ Jurisdictions β”‚ FEC β”‚
β”‚ β€’ 90k+ cities ──────────┴───> β€’ Political donations β”‚
β”‚ β€’ Meeting minutes β€’ Donor employers β”‚
β”‚ β€’ Contact info β€’ Recipients β”‚
β”‚ β€’ Demographics β€’ Amounts & dates β”‚
β”‚ β”‚ β”‚
β”‚ β”‚ β”‚
β”‚ Voter Data β”‚
β”‚ β€’ Party affiliation β”‚
β”‚ β€’ Elected officials β”‚
β”‚ β€’ Turnout β”‚
β”‚ β”‚
β”‚ COMBINED ANALYSIS: β”‚
β”‚ ➀ Political influence on grant awards β”‚
β”‚ ➀ Donor networks in health policy β”‚
β”‚ ➀ Partisan patterns in funding β”‚
β”‚ ➀ Timeline: Donation β†’ Policy β†’ Grant β”‚
β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
## ⚑ Quick Start
### 1. Get API Keys (5 minutes)
**FEC API** (Required for political data):
```bash
# Get free API key at:
https://api.data.gov/signup/
# Enter email β†’ Receive key instantly
# Or use DEMO_KEY for testing (limited)
```
**Other APIs** (Optional):
- OpenStates (state legislators): https://openstates.org/accounts/profile/
- Google Civic (local officials): https://console.cloud.google.com
### 2. Test Integrations
**Test Grants.gov** (no key required):
```bash
python examples/demo_grants_gov.py
```
Output: Federal oral health grant opportunities β†’ `data/gold/grants/`
**Test FEC** (requires API key):
```bash
python examples/demo_political_influence.py --api-key YOUR_FEC_KEY
```
Output: Political contributions from health sector β†’ `data/gold/fec/`
### 3. Run Complete Analysis
```bash
# 1. Generate grant opportunities
python examples/demo_grants_gov.py
# 2. Find political connections
python examples/demo_political_influence.py --api-key YOUR_FEC_KEY
# 3. Match to your nonprofits (if you have officer data)
python discovery/fec_integration.py \
--api-key YOUR_FEC_KEY \
--state MA \
--employer "health"
```
## πŸ“š Documentation
### Integration Guides
1. **[Grants.gov API](../website/docs/integrations/grants-gov-api.md)**
- Federal grant opportunities
- No API key required
- Search by keyword, agency, funding category
- Match to eligible nonprofits
2. **[FEC Political Contributions](../website/docs/integrations/fec-political-contributions.md)**
- Individual campaign donations
- Free API key required
- Link to nonprofit employers
- Track political influence
3. **Voter Data Integration**
- Political demographics
- Elected officials
- State-specific sources
- Commercial vendors (L2, Aristotle)
### Example Analyses
- **[Political Influence Integration](POLITICAL_INFLUENCE_INTEGRATION.md)** - Complete analysis examples
- **[Grants.gov Value](GRANTS_GOV_VALUE.md)** - Data comparison and ROI
## 🎯 Use Cases
### 1. Grant Opportunity Alerts
**Before**: Nonprofits miss deadlines
**After**: Automated alerts
```
"NEW Grant Alert: HRSA Oral Health Workforce Development"
β€’ Award: $500k-$2M
β€’ Deadline: Dec 31, 2024
β€’ Your organization is eligible!
β€’ Similar MA orgs received avg $800k from this program
```
### 2. Political Transparency
**Before**: Hidden connections
**After**: Public disclosure
```
Political Connections:
β€’ 2 officers made political donations
β€’ Total: $8,500 (2024 cycle)
β€’ Recipients: Sen. Warren (D), Rep. Kennedy (D)
β€’ Federal grants received: $800,000 (2023)
```
### 3. Influence Analysis
**Before**: Speculation about political influence
**After**: Data-driven analysis
```
Research Finding:
β€’ Nonprofits with politically active leaders: $450k avg grant
β€’ Nonprofits without political activity: $280k avg grant
β€’ Difference: $170k (p < 0.05)
β€’ Context: Many factors influence grants
```
### 4. Partisan Patterns
**Before**: Anecdotal observations
**After**: Quantitative analysis
```
Oral Health Funding by Political Context:
β€’ Democratic-controlled states: $2.1M avg
β€’ Republican-controlled states: $1.8M avg
β€’ Swing states: $2.3M avg
β€’ Analysis: More urban states (often blue) have more nonprofits
```
## πŸ—‚οΈ File Structure
```
discovery/
β”œβ”€β”€ grants_gov_integration.py # Grants.gov API client
β”œβ”€β”€ fec_integration.py # FEC political contributions
└── voter_data_integration.py # Voter data and elected officials
examples/
β”œβ”€β”€ demo_grants_gov.py # Grant opportunities demo
β”œβ”€β”€ demo_political_influence.py # FEC integration demo
β”œβ”€β”€ GRANTS_GOV_VALUE.md # Grants.gov data comparison
└── POLITICAL_INFLUENCE_INTEGRATION.md # Complete analysis guide
website/docs/integrations/
β”œβ”€β”€ grants-gov-api.md # Grants.gov documentation
└── fec-political-contributions.md # FEC documentation
data/gold/
β”œβ”€β”€ grants/
β”‚ └── oral_health_opportunities.parquet # Federal grants
β”œβ”€β”€ fec/
β”‚ └── political_contributions.parquet # Political donations
└── states/MA/
β”œβ”€β”€ nonprofits_organizations.parquet # Organizations
β”œβ”€β”€ nonprofits_officers.parquet # Leadership
β”œβ”€β”€ grants_revenue_sources.parquet # Revenue breakdown
└── available_grants.parquet # Matched opportunities
```
## πŸ’‘ Analysis Examples
### Find Political Connections
```python
from discovery.fec_integration import OpenFECAPI, PoliticalContributionMatcher
import pandas as pd
# Load your data
officers = pd.read_parquet("data/gold/states/MA/nonprofits_officers.parquet")
# Find political contributions
api = OpenFECAPI(api_key="your_key")
matcher = PoliticalContributionMatcher(api)
contributions = matcher.find_nonprofit_leadership_contributions(
officers_df=officers,
state_code="MA",
min_amount=200
)
print(f"Found {len(contributions):,} political donations")
print(f"Total: ${contributions['contribution_amount'].sum():,.2f}")
```
### Match Grants to Nonprofits
```python
from discovery.grants_gov_integration import GrantsGovAPI, GrantMatcher
# Find oral health grants
api = GrantsGovAPI()
matcher = GrantMatcher(api)
grants = matcher.find_oral_health_grants(opp_statuses="posted")
# Load nonprofits
nonprofits = pd.read_parquet("data/gold/states/MA/nonprofits_organizations.parquet")
# Match grants to eligible MA orgs
matches = matcher.match_grants_to_state(
state_code="MA",
grants_df=grants,
nonprofits_df=nonprofits
)
print(f"{len(matches):,} grant opportunities for MA orgs")
```
### Analyze Influence
```python
from discovery.fec_integration import PoliticalContributionMatcher
# Load all data
grants = pd.read_parquet("data/gold/states/MA/grants_revenue_sources.parquet")
contributions = pd.read_parquet("data/gold/fec/political_contributions.parquet")
# Analyze political influence patterns
matcher = PoliticalContributionMatcher(api)
influence = matcher.analyze_political_influence(
contributions_df=contributions,
grants_df=grants
)
# Results
print("Political Activity vs. Grant Awards:")
print(influence[['total_political_donations', 'total_grants_received']])
```
## πŸ”’ Privacy & Ethics
### Important Guidelines
βœ… **DO**:
- Present data transparently
- Provide full context
- Allow verification
- Focus on patterns
- Respect privacy laws
❌ **DON'T**:
- Imply wrongdoing without evidence
- Selectively present data
- Use partisan language
- Target individuals
- Draw unsupported conclusions
### Disclaimers
1. **FEC data is public record** - legal, transparent political participation
2. **Correlation β‰  causation** - many factors influence grant awards
3. **Personal vs. institutional** - officers donate as individuals
4. **Context matters** - civic engagement is protected speech
## πŸ“ˆ ROI Summary
### Setup Time
- Grants.gov: **0 minutes** (no auth required)
- FEC API: **5 minutes** (free signup)
- Voter data: **Varies** (state-specific or commercial)
### Cost
- Grants.gov: **FREE**
- FEC API: **FREE**
- Voter data: **FREE** (aggregated) or **$-$$$** (individual-level)
### Value
- **Differentiation**: Unique feature no one else has
- **Transparency**: Build trust through openness
- **Insights**: Data-driven political analysis
- **Advocacy**: Strategic engagement tools
- **Impact**: Better informed democracy
### Maintenance
- Grants.gov: Daily automated fetches (5 min setup)
- FEC: Weekly batch updates (cron job)
- Voter data: Monthly updates (varies by source)
## 🚦 Next Steps
### Immediate (Today)
- [ ] Get FEC API key (5 min): https://api.data.gov/signup/
- [ ] Run Grants.gov demo: `python examples/demo_grants_gov.py`
- [ ] Run FEC demo: `python examples/demo_political_influence.py --api-key KEY`
- [ ] Review generated data in `data/gold/`
### Short-term (This Week)
- [ ] Match grants to your nonprofits
- [ ] Find political connections in your officer data
- [ ] Create first analysis: donation β†’ grant timeline
- [ ] Build basic dashboard widget
### Medium-term (This Month)
- [ ] Set up automated daily grant fetching
- [ ] Build email alert system for grant opportunities
- [ ] Create political transparency page
- [ ] Launch "Political Connections" feature
### Long-term (This Quarter)
- [ ] Integrate voter data (state or commercial)
- [ ] Build comprehensive influence analysis
- [ ] Create network visualizations
- [ ] Publish research findings
- [ ] Partner with journalists/researchers
## πŸ†˜ Troubleshooting
### "No contributions found"
- Check API key is valid
- Try broader search parameters
- Use `DEMO_KEY` for testing (limited)
- Verify employer names match exactly
### "File not found"
- Run demos to generate data first
- Check file paths are correct
- Ensure you have MA nonprofit data
- Generate missing data (see commands above)
### "Rate limit exceeded"
- FEC API: 1,000 requests/hour with key
- Use DEMO_KEY sparingly (30/hour)
- Add delays between requests
- Batch operations overnight
### "Empty results"
- Many nonprofits have no political activity (normal!)
- Try different search parameters
- Expand date range
- Lower minimum amount
## πŸ“ž Support
- **Documentation**: See `website/docs/integrations/`
- **Examples**: See `examples/` directory
- **Issues**: Check error messages and API docs
- **Questions**: Review analysis examples in POLITICAL_INFLUENCE_INTEGRATION.md
## πŸŽ‰ Success Metrics
You'll know it's working when you can answer:
βœ… "Which federal oral health grants are available RIGHT NOW?"
βœ… "Which nonprofit leaders made political donations?"
βœ… "What's the relationship between donations and grants?"
βœ… "Do partisan patterns exist in oral health funding?"
βœ… "Which advocacy networks are most politically engaged?"
**You now have the most comprehensive political-financial tracking system for civic engagement. Use it to build transparency, enable advocacy, and strengthen democracy!** πŸš€