A python library that scrapes and parses campaign finance data from the Florida Secretary of State's website.
This package isn't on PyPI yet, so install from the repo:
pip install git+https://github.com/SunSentinel/SunScrape.git
SunScrape makes it possible to grab campaign finance data in bulk in a usable, machine-readable format.
This library provides a way to search Florida's campaign finance portal either by a particular entity or a specific filing type.
Results can be obtained for a particular candidate or committee.
Results for a candidate.
Results of a particular committee registered in the state. A list of these committees can be found here: https://dos.elections.myflorida.com/committees/ComLkupByName.asp
You can also search through all contributions, expenses or fund transfers reported to the SOS's office. Additional search terms can also be passed to these object:
candidate_first
- Candidate first namecandidate_last
- Candidate last namefrom_date
- Start date (MM/DD/YYYY)to_date
- End date (MM/DD/YYYY)committee_name
- Committee name, or partial nameelection_id
- See Election IDsall_time
-True
orFalse
, returns results for all years
Example
>>> from sunscrape.contributions import ContributionScraper
>>> scraper = ContributionScraper(candidate_first='Ron', candidate_last='Desantis')
>>> scraper.results
[{'candidate': 'DeSantis, Ron', 'candidate_party': 'Republican', 'date': '2018-07-18', 'amount': '3000.00', 'type': 'CHE', 'contributor_name': '1188 PARTNERS, LLC', 'contributor_address': '2141 ALAQUA DRIVE', 'contributor_address2': 'LONGWOOD, FL 32779', 'contributor_occupation': 'INSURANCE', 'inkind_description': ''}...]
The library allows finance records searches by election, but you need the election ID used by the Secretary of State. You can find these with the get_election_ids()
method.
The SOS's expenditure and fund transfer search portals fail when specifying a date, so we excluded these options from the expenditures
and transfers
objects. Though it is still possible to use the arguments in contributions
objects.
- Python 3
- Virtual environment
- Clone this repository:
git clone https://github.com/SunSentinel/SunScrape.git
- Change into project directory:
cd SunScrape
- Start up your virtual environment.
- Install SunScrape from local source:
pip install -e .
- Install requirements:
pip install -r requirements.txt
orpipenv install
for pipenv users.
pytest
Want to help out? Submit an issue or pull request.