Top Rep$

Week 7: Top Rep$

(March design iteration)

(March design iteration)

Introducing Top Rep$, 115th Congress Edition, an educational card game inspired by Top Trumps to promote awareness of members of the United States Congress and to prompt dialogue about the current state of campaign finance and federal lobbying, with a specific focus on funds donated in support or spent in opposition by the National Rifle Association (NRA). With the continued congressional gridlock on gun control, Top Rep$ is dedicated to the surviving families of our country's most recent mass shooting in Parkland, Florida.

For the assignment to automatically manipulate scraped images or video, I built a tool to help me learn more about Congress and what monies flow into members' campaign offices. I was initially motivated to understand who favors gun rights in a country with more mass shootings than anywhere else. I know that the United States' relationship with guns is complicated, and this data is simply a slice of a much larger story. Nevertheless I'm curious, and it's a place to start. Though I began at the Federal Election Commission, it wasn't long before I discovered the Center for Responsive Politics, an organization that not only analyzes and creates contribution profiles from the FEC's campaign finance data but also publishes reports on a variety of issues, including gun rights, on their website

Similar to the original game, each card in Top Rep$ depicts one person, five categories of numerical values, and some brief additional information. Each card, 531 in all at this current moment, contains thirteen pieces of data. Some scraped and some copied and pasted, I organized all of the data into one Google spreadsheet to populate an InDesign template and generate individual cards for each representative. While the total deck includes both U.S. Senators and House Representatives, it does not include non-voting House members nor does it account for current House vacancies. I collected all information from March 11-13, 2018.

My representative in the House. (July design iteration)

My representative in the House. (July design iteration)

Here's a breakdown of each data point and the process by which I retrieved it. All code is posted on GitHub, along with some of the raw data, my final spreadsheet, and the digital card files.

  1. Portraits - Thumbnail images for members of the 115th Congress were scraped from the and converted to grayscale using a subprocess call to an ImageMagick grayscale conversion. Quick to receive a 429 error with a Beautiful Soup start, I switched to Selenium, located the image URL by XPath syntax, and due to inconsistent file naming, retitled each image with each representative's name. A number of members (~40 and mostly recently elected officials) lacked images, so I used this blank person clip art, adding my own neutral gray background. 
  2. Party Affiliation - Republican, Democratic, and Independent converted from the abbreviations, R, D and I, on the OpenSecrets' Gun Rights vs. Gun Control spreadsheet.
  3. Office - Senator and Representative converted from the abbreviations, S and H, on the OpenSecrets' Gun Rights vs. Gun Control spreadsheet.
  4. State - State abbreviations extracted from the Distid field on the OpenSecrets' Gun Rights vs. Gun Control spreadsheet. I also learned how to add a custom function to Google Sheets to convert those State abbreviations into their full names using code from Dave Gaeddert.
  5. Names - Collected and compared against several sources: the portrait scrape, the directory and their Gun Rights vs. Gun Control data tabulation, and committee assignment information for both chambers (see below).
  6. Committees - Already in table format, I copied and pasted this data from the House of Representatives Committee Information and Senate Committee Assignments. Of note, the Office of the Clerk for the House of Representatives does not list joint committee assignments, but the Senate does. This information was added to House representatives where appropriate using committee websites as source material. Since historical data is provided on the playing cards, it worth mentioning that brand new committees as of 2018 include the Joint Select Committee on Solvency of Multiemployer Pension Plans and the Joint Select Committee on Budget and Appropriations Process Reform.
  7. Years in this Chamber. Again using XPath syntax I scraped "Years in Service" from the directory at For some reason about which I'm still unclear, I was unable to pull data from both chambers at once, so instead I wrote two scripts, filtering the chamber in the initial url request. To calculate the total number of years in the spreadsheet, I extracted the base year from the string and subtracted it from 2018. Manually calculating it for those officials serving nonconsecutive terms in the House. It was not until I started working with the data that I realized that again the most recently elected officials (within the last year) were missing, and so their service years were computed by hand. Of note, Top Rep$ lists number of years served in the current chamber, however some senators sat in the House before the Senate. Career totals for gun rights support and campaign fundraising, however, account for all of their years as an elected federal representative. 
  8. NRA $ Ranking* - Based on NRA Grand Total, see #9 below.
  9. NRA Grand Total - From the Gun Rights vs. Gun Control document, specifically the "NRA spending (115th Congress)" sheet, I pulled data from the field, NRA Grand Total. The NRA is the top gun rights contributor. Notes from the Center for Responsive Politics regarding this data: "These are career totals, and so therefore can go as far back as 1989. NRA direct support includes contributions from the NRA PAC and employees to candidates. Indirect support includes independent expenditures (and electioneering communications) supporting the candidate; opposition is IEs and ECs opposing the candidate. 'Independent expenditures for opponent' is spending by the NRA supporting a candidate OTHER than the member listed (note that could be someone of the same party, if they supported someone else in the primary), and "Indep Expend against opponent" is spending by the NRA opposing a candidate OTHER than the member listed. For the grand total, we summed the direct support + indirect support + indep expend against opponent, and then subtracted indirect opposition and indirect expenditures for the opponent. This produces a grand total, which can be, and often is, negative. A negative value indicates that the NRA tends to oppose this member."
  10. Campaign Committee Fundraising Top Industry - After spending some time on the OpenSecrets congressional directory, I decided to maintain consistency with gun rights data and pull career totals for each member of the 115th Congress, in this case the leading industry and total amount contributed. I was curious to see this landscape over time (how do totals compare for varying amounts of years served?) and in comparison to members' committee work (do the top industries align with their assignments?). I tried and failed to scrape this information successfully: except for the representative's name, the top industry name and total amounts always returned empty strings (even though at one point I figured out how to extract the elements' attribute data). While I located a number of related issues on Stack Overflow, nothing panned out. Fully committed to the project at this point and working to meet a printing deadline, I visited each page individually and copied the information I needed. (My thoughts on this non-automated process below.)
  11. Campaign Committee Fundraising Top Industry Amount - See above.
  12. Campaign Contributor Top Contributor - Same as above but for top contributors.
  13. Campaign Contributor Top Contributor Amount -  Same as above but for top contribution amounts.

    *July 2018 Update: For the March design iteration this category was called Gun Rights and from the Gun Rights vs. Gun Control document, specifically the "Career Gun $ to 115th Congress" sheet, totaled amounts from three columns: Total from Gun Rights (Pink), Gun Control Opposed (Blue), and Gun Rights Support (Blue). After reviewing the sheet in July, I mistakenly interpreted Gun Control Opposed as groups opposed to gun control instead of representing groups advocating for gun control that have spent money to oppose the individual. In fact, further investigation reveals that I need to confirm with the Center for Responsive Politics how the Career Gun amounts differs from the NRA spending totals. Until then, the updated card set will only pull amounts from the "NRA Grand Total" and corresponding "Rank" from the dataset.

Additional credits: It's one thing to look at data across a spreadsheet and another to see it take form into individual playing cards in InDesign. To spiffify them I added the Great Seal of the United States 1904 Coat of Arms to the backs, and used the fonts, Gregory Packaging and Proxima Nova Light.

So yeah: I visited each representative's profile at to copy and paste campaign fundraising data. I checked the API when I stumbled onto the site, but I should revisit it now that I have a sense of the data I want. Next time I'll also investigate requesting a custom data report or troubleshoot my initial scraping hurdle in this area. That being said, retrieving the data became a meditation, and I started to visualize the geography of the country through the lens of industry that might have eluded me had I not been so thoroughly steeped in the data (or until I actually played the game a million times). Receive large contributions from Microsoft? You most likely represent the state of Washington. Walmart? Arkansas. Funded by oil and gas companies? You probably hail from large states west of the Mississippi. And so on. In addition, although not surprising, committee assignments often matched with top industries and contributors. Serve on the Committee of Financial Services? There's likely a large bank (or several) on your list. The Senate Committee on Health, Education, Labor, and Pensions? Look for the health professionals or pharmaceuticals/health products industries. As for gun rights support recipients, aside from the expected partisan divide, I have more studying to do. But it does make me wonder about other tangible ways of working with this and similar datasets to see relationships I hadn't otherwise considered. (And for future Ellen: I'm quite intrigued by some of the anomalies tracked on, such as the percentage of contributions received by politicians from out of their home states.)