llm-fecfile is an LLM plugin for analyzing FEC (Federal Election Commission) campaign finance filings. This plugin allows you to load FEC filings as fragments and analyze them using natural language through the LLM command-line tool.
Installation
Install this plugin in the same environment as LLM:
llm install llm-fecfile
Usage
The plugin provides a fragment loader with the fec: prefix that loads FEC campaign finance filings and provides structured analysis instructions to help you understand the data.
Basic Usage
# Load and analyze a specific FEC filing by ID
llm -f fec:1896830 "What are the key financial aspects of this filing?"
# Ask about specific aspects of the filing
llm -f fec:1896830 "Who are the largest contributors?"
# Get an overview of spending patterns
llm -f fec:1896830 "What are the biggest expenditures and what were they for?"
What the Fragment Provides
When you use -f fec:FILING_ID, the plugin:
- Loads the complete FEC filing using the
fecfilelibrary - Provides response style instructions to ensure clear, readable analysis
- Includes form-specific guidance based on the filing type (F1, F2, F3, F99, etc.)
- Offers detailed field mapping for contributions, disbursements, and other itemizations
- Includes the complete raw filing data in JSON format for comprehensive analysis
The fragment includes specialized instructions for different form types:
- F1/F1A: Committee registration and organizational details
- F2/F2A: Candidate declarations and information
- F3/F3P/F3X: Financial reports with receipts, disbursements, and itemizations
- F99: Miscellaneous text filings
Example Queries
Once you've loaded a filing as a fragment, you can ask various questions:
Financial Analysis
llm -f fec:1896830 "What's the total amount raised and spent in this reporting period?"
llm -f fec:1896830 "What's the cash on hand at the end of this period?"
llm -f fec:1896830 "Is this an amendment? If so, what filing does it amend?"
Contribution Analysis
llm -f fec:1896830 "Who are the top 10 individual contributors?"
llm -f fec:1896830 "What contributions came from California?"
llm -f fec:1896830 "Show me all contributions over $2,000"
Expenditure Analysis
llm -f fec:1896830 "What are the largest expenditures?"
llm -f fec:1896830 "How much was spent on advertising?"
llm -f fec:1896830 "Who received the most money from this committee?"
llm -f fec:1896830 "What types of expenses are listed?"
Time-based Analysis
llm -f fec:1896830 "How many days does this filing cover?"
llm -f fec:1896830 "What was the average daily fundraising rate?"
Understanding FEC Filings
The plugin provides guidance for understanding different schedules in FEC filings:
- Schedule A: Individual contributions received (itemized contributions $200+)
- Schedule B: Disbursements and expenditures (itemized expenditures $200+)
- Schedule C: Loans received
- Schedule D: Debts and obligations
- Schedule E: Independent expenditures
Finding Filing IDs
You can find FEC filing IDs in several ways:
- FEC Website: Visit fec.gov and search for a committee
- Direct URLs: Filing IDs appear in URLs like
https://docquery.fec.gov/dcdev/posted/1690664.fec - FEC API: Use the FEC API to search for filings
Multi-Filing Analysis
You can load multiple filings to compare them:
# Compare two different filings
llm -f fec:1896830 -f fec:1893645 "Compare the fundraising performance between these two filings"
Limitations
- Filing Availability: Not all filings may be immediately available through the FEC's API
- Network Dependency: Requires internet connection to fetch filing data
- Large Filings: Very large filings may take time to load and process
Development
To develop this plugin:
git clone https://github.com/dwillis/llm-fecfile
cd llm-fecfile
pip install -e .
Running Tests
python test_plugin.py
The test suite includes:
- Filing ID validation tests
- Form type instruction tests
- Fragment creation tests
- Error handling tests
- Manual integration tests with real filings
Dependencies
This plugin requires Python 3.9 or greater.
This plugin depends on:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a pull request.
When contributing:
- Ensure tests pass with
python test_plugin.py - Follow the existing code style
- Update documentation for any new features
Acknowledgments
Metadata
Release files for llm-fecfile 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llm_fecfile-0.1.0.tar.gz | 10.6 kB | Without provenance | Details for llm_fecfile-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llm_fecfile-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llm_fecfile-0.1.0-py3-none-any.whl |
Total release size: 21.1 kB
Release files / llm_fecfile-0.1.0.tar.gz
| Download URL | llm_fecfile-0.1.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97bef7d7bfdacc1b4ab77106981b83b3477ed498197646715337453263aa7556
|
|
BLAKE2b-256 checksum How to use checksums |
f46022ab8e8289f85166c51e628cf3aabe655a055fdb9ffd947029c51c0e4721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.1
|
Release files / llm_fecfile-0.1.0-py3-none-any.whl
| Download URL | llm_fecfile-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab963bfc49db215fdf7416559d815622f74800adf7f7d9fddd1c372932d06bc1
|
|
BLAKE2b-256 checksum How to use checksums |
4a9ca262e0e54e35d12bdde4c57dda43b62813c7b9002dad2bacef1e4c9e451a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.1
|
Security for llm-fecfile 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.