Python Congress Documentation

Similar documents
Congress Lobbying Database: Documentation and Usage

LobbyView: Firm-level Lobbying & Congressional Bills Database

DevOps Course Content

2018 County/SD Convention Training RACHEL MALONE, OPERATIONS DIRECTOR

Community Electoral Education Kit

Managing Large Scale Drupal and Agile Culture by Dinesh Waghmare, TCS

Review of Lab 9. Review Lab 9. Social Network Classes/Driver Data. Lab 10 Design

Health Coach Week. February 12th-18th HEALTH COACH WEEK

The Pupitre System: A desk news system for the Parliamentary Meeting rooms

User Guide. News. Extension Version User Guide Version Magento Editions Compatibility

File Systems: Fundamentals

M-Polling with QR-Code Scanning and Verification

info URIs & OpenURL Applications for Identifier Resolution

KENTUCKY. Jim Swain, Chief Information Officer Legislative Research Commission. Monday, August 6, 2012

UTAH LEGISLATIVE BILL WATCH

Plan For the Week. Solve problems by programming in Python. Compsci 101 Way-of-life. Vocabulary and Concepts

HOW TO RUN AN ONLINE ELECTION

Teller County Board of Review November 7, 2012 Meeting Minutes

Package rtimes. August 11, 2017

ForeScout Extended Module for McAfee epolicy Orchestrator

CS 5523: Operating Systems

PERCEPTIONS ARE SOME PEOPLES REALITY: WHAT KIND OF COURT ARE YOU?

Candidate s Guide (F0405)

101 Ready-to-Use Excel Macros. by Michael Alexander and John Walkenbach

Student Choice IN YOUR STATE. A Lobbying Guide ABOUT THE HSUS. [ Promote Cruelty-Free Research ]

IBM Cognos Open Mic Cognos Analytics 11 Part nd June, IBM Corporation

Order of Business for a 4-H Meeting

Kupindo API Terms and Conditions

FACULTY OF GEO-INFORMATION SCIENCE AND EARTH OBSERVATION (ltc FACULTY) OF THE UNIVERSITY OF TWENTE PhD ITC COMMUNITY (pitcom.)

Lunch & Learn (L&L) Advocacy and the Importance of Voter Registration

OVERVIEW OF CAMPAIGN DETAILS:

Scheduling a meeting.

Discretionary Authority

Coverage tools Eclipse Debugger Object-oriented Design Principles. Oct 26, 2016 Sprenkle - CSCI209 1

The new Voteview.com: preserving and continuing. observers of Congress

Downloaded from: justpaste.it/vlxf

"Commercial Use" means distribution or otherwise making the Covered Code available to a third party.

Working with the Supreme Court Database

Chapter Four: Chamber Competitiveness, Political Polarization, and Political Parties

COMMISSION DECISION. of

OPEN DATA AND ECLI AT THE CONSTITUTIONAL COURT

M-Vote (Online Voting System)

NOMINATIONS AND ELECTIONS. Procedure to Fill Offices

ICC Rules of Conciliation and Arbitration 1975

Thinking Like a Computer Scien4st About Ancient Roman Graffi4

Welcome! To the 2017 AWWA Water Matters! Fly-In Prep Webinar March 2, Enhance Your Webinar Experience

AP Government THE US CONSTITUTION STUDY GUIDE. Welcome to AP GoPo!

Copy. Judgment IN THE NAME OF THE PEOPLE. Christoph Hellwig, Schidlachstraße 11, 6020 Innsbruck, Austria - Plaintiff -

Google App Engine 8/10/17. CS Cloud Compu5ng Systems--Summer II 2017

Colorado Channel Authority Board July 2014 Meeting Agenda Friday, July 18th, 2014, 12pm 1pm

Fear's Empire: War, Terrorism, And Democracy By Benjamin R. Barber

Today I am going to speak about the National Digital Newspaper Program or NDNP, the Historic Maryland Newspapers Project or HMNP--the Maryland

AP ELECTIONS API 2.1. Developer s Guide Revision 1.1

This document has been provided by the International Center for Not-for-Profit Law (ICNL).

The Byrds' Notorious Byrd Brothers (33 1/3) By Ric Menck READ ONLINE

Guidance for candidates and agents

LEGISLATIVE UPDATE: THE 84TH LEGISLATIVE SESSION

CENTRAL FLORIDA REPEATER ASSOCIATION Charter Number N18829 *** By-Laws ***

Your Objectives - A Successful Campaign is Simple

3. Requirements and Limitations. Your use of Shutterfly Open API is subject to the following limitations:

3.1 Inaugural General Meeting (IGM)

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Cocaine Anonymous of Colorado, Inc. Bylaws and Area Guidelines. Last Revised: September 11, 2014 Revision 4

12/12/2009. Call to Order: 10:10 AM. Roll Call: Districts Present 1, 2, 4, 5, 6, 13, 14, 15, 18

25th LEGISLATIVE DISTRICT DEMOCRATIC FOCUS

APPLICATION: PIVOTAL POLITICS

13 ADVANCED TRIAL TIPS. Gary K. Burger BURGER LAW BurgerLaw.com

Klepto By Jenny Pollack READ ONLINE

Company President Responsibilities

INFORMATION AS THE FOUNDATION FOR SOCIAL SOLIDARITY THE ROLE OF PARLIAMENTARY LIBRARIES AND RESEARCH SERVICES

Installation Guide: Plesk 12 ServerShield and ServerShield Plus

The Legal Ethics of Drafting Legal Opinions: Outside Counsel Perspective

Searching from Scratch No access to Westlaw - where do you start?

How To Conduct A Meeting:

City of Orillia Tabulator Instructions

Management Overview. Introduction

University of North Florida Public Opinion Research Lab

Cloud Tutorial: AWS IoT. TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li

FARMERSVILLE CITY COUNCIL MEETING MINUTES November 10, 2009

Data Distribution Agreement of BME Market Data

THE ROLE OF IDENTITY MANAGEMENT IN FACILITATION AND ENHANCING BORDER SECURITY

Text UI. Data Store Ø Example of a backend to a real Could add a different user interface. Good judgment comes from experience

Office for Democratic Institutions and Human Rights REPUBLIC OF ESTONIA. PARLIAMENTARY ELECTIONS 4 March 2007

Smart Voting System using UIDAI

CITY OF BELLINGHAM PLANNING COMMISSION BYLAWS

2 The Mathematics of Power. 2.1 An Introduction to Weighted Voting 2.2 The Banzhaf Power Index. Topic 2 // Lesson 02

LEGISLATIVE UPDATE: THE 84TH LEGISLATIVE SESSION

General Rulebook (GEN)

St. Augustin Home and School Association Bylaws. Article I

TITLE III: THE LEGISLATIVE BRANCH

A. How Much is Life Without Parole Used for Murderers and Other Prisoners? B. Life Without Parole: An Alternative to the Death Penalty

The Electronic Communications Act (2003:389)

Collection Development Policy Federal Government Documents Ouachita Baptist University Library

Nevada Chamber Newsletter July 10, 2013

USTOCKTRAIN TRADING SIMULATOR TERMS AND CONDITIONS

Immigration Study Guide 2018 READ ONLINE

Installation Guide: cpanel Plugin

The Debate On The Constitution: Part One: September 1787 To February 1788 (The Library Of America, Part One) By Bernard Bailyn

COMMON COUNCIL AGENDA APRIL 26, 2011 NORWALK, CONNECTICUT 8:00 P.M. DST. COUNCIL CHAMBERS

SIMON READHEAD Q.C. PRIVACY NOTICE

Transcription:

Python Congress Documentation Release 0.3.2 Chris Amico Mar 04, 2018

Contents: 1 Install 3 2 Usage 5 2.1 API.................................................... 6 3 Indices and tables 9 Python Module Index 11 i

ii

Python Congress Documentation, Release 0.3.2 A Python client for the ProPublica Congress API Contents: 1

Python Congress Documentation, Release 0.3.2 2 Contents:

CHAPTER 1 Install From PyPI: pip install python-congress Download and run the install script: git clone https://github.com/eyeseast/propublica-congress && cd propublica-congress python setup.py install 3

Python Congress Documentation, Release 0.3.2 4 Chapter 1. Install

CHAPTER 2 Usage The main entrypoint for the API is the Congress class, which is instantiated with your API key. (Request an API key at ProPublica s data store.) Endpoints are organized into subclients attached to the main Congress instance. For example: >>> from congress import Congress >>> congress = Congress(API_KEY) # get member by bioguide ID >>> pelosi = congress.members.get('p000197') >>> pelosi['twitter_id'] 'NancyPelosi' # get recent House bills # recent bills come in two types: 'introduced' and 'updated' >>> introd = congress.bills.recent(... chamber='house',... congress=115,... type='introduced') >>> len(introd['bills']) 20 >>> introd['chamber'] 'House' # or use a convenience function >>> introd = congress.bills.introduced('house') >>> introd['chamber'] 'House' >>> len(introd['bills']) 20 5

Python Congress Documentation, Release 0.3.2 2.1 API 2.1.1 Congress A Python client for the ProPublica Congress API API docs: https://propublica.github.io/congress-api-docs/ class congress.congress(apikey=none, cache=.cache, http=none) Implements the public interface for the ProPublica Congress API Methods are namespaced by topic (though some have multiple access points). Everything returns decoded JSON, with fat trimmed. In addition, the top-level namespace is itself a client, which can be used to fetch generic resources, using the API URIs included in responses. This is here so you don t have to write separate functions that add on your API key and trim fat off responses. Create a new instance with your API key, or set an environment variable called PROPUBLICA_API_KEY. Congress uses httplib2, and caching is pluggable. By default, it uses httplib2.filecache, in a directory called.cache, but it should also work with memcache or anything else that exposes the same interface as FileCache (per httplib2 docs). Example: Using a custom cache object Redis is a good option for a cache that can be shared between processes. >>> from redis import StrictRedis >>> from congress import Congress >>> db = StrictRedis() >>> congress = Congress(API_KEY, cache=db) >>> senate = congress.members.filter('senate') # hits the API, caching the result >>> senate = congress.members.filter('senate') # uses the cache 2.1.2 Members class congress.members.membersclient(apikey=none, cache=.cache, http=none) bills(member_id, type= introduced ) Same as BillsClient.by_member compare(first, second, chamber, type= votes, congress=115) See how often two members voted together in a given Congress. Takes two member IDs, a chamber and a Congress number. departing(chamber, congress=115) Takes a chamber and congress and returns a list of departing members filter(chamber, congress=115, **kwargs) Takes a chamber and Congress, OR state and district, returning a list of members get(member_id) Takes a bioguide_id, returns a legislator new(**kwargs) Returns a list of new members 6 Chapter 2. Usage

Python Congress Documentation, Release 0.3.2 party() Get state party counts for the current Congress 2.1.3 Bills class congress.bills.billsclient(apikey=none, cache=.cache, http=none) by_member(member_id, type= introduced ) Takes a bioguide ID and a type: (introduced updated cosponsored withdrawn) Returns recent bills introduced(chamber, congress=115) Shortcut for getting introduced bills major(chamber, congress=115) Shortcut for major bills passed(chamber, congress=115) Shortcut for passed bills recent(chamber, congress=115, type= introduced ) Takes a chamber, Congress, and type: (introduced updated) Returns a list of recent bills upcoming(chamber, congress=115) Shortcut for upcoming bills updated(chamber, congress=115) Shortcut for getting updated bills 2.1.4 Votes class congress.votes.votesclient(apikey=none, cache=.cache, http=none) by_date(chamber, date) Return votes cast in a chamber on a single day by_month(chamber, year=none, month=none) Return votes for a single month, defaulting to the current month. by_range(chamber, start, end) Return votes cast in a chamber between two dates, up to one month apart. by_type(chamber, type, congress=115) Return votes by type: missed, party, lone no, perfect get(chamber, rollcall_num, session, congress=115) Return a specific roll-call vote, including a complete list of member positions loneno(chamber, congress=115) How often is each member the lone no vote? missed(chamber, congress=115) Missed votes by member nominations(congress=115) Return votes on nominations from a given Congress party(chamber, congress=115) How often does each member vote with their party? 2.1. API 7

Python Congress Documentation, Release 0.3.2 perfect(chamber, congress=115) Who never misses a vote? today(chamber) Return today s votes in a given chamber 2.1.5 Committees class congress.committees.committeesclient(apikey=none, cache=.cache, http=none) 2.1.6 Nominations class congress.nominations.nominationsclient(apikey=none, cache=.cache, http=none) 8 Chapter 2. Usage

CHAPTER 3 Indices and tables genindex modindex search 9

Python Congress Documentation, Release 0.3.2 10 Chapter 3. Indices and tables

Python Module Index c congress, 6 congress.bills, 7 congress.committees, 8 congress.members, 6 congress.nominations, 8 congress.votes, 7 11

Python Congress Documentation, Release 0.3.2 12 Python Module Index

Index B bills() (congress.members.membersclient method), 6 BillsClient (class in congress.bills), 7 by_date() (congress.votes.votesclient method), 7 by_member() (congress.bills.billsclient method), 7 by_month() (congress.votes.votesclient method), 7 by_range() (congress.votes.votesclient method), 7 by_type() (congress.votes.votesclient method), 7 C CommitteesClient (class in congress.committees), 8 compare() (congress.members.membersclient method), 6 Congress (class in congress), 6 congress (module), 6 congress.bills (module), 7 congress.committees (module), 8 congress.members (module), 6 congress.nominations (module), 8 congress.votes (module), 7 D departing() (congress.members.membersclient method), 6 F filter() (congress.members.membersclient method), 6 G get() (congress.members.membersclient method), 6 get() (congress.votes.votesclient method), 7 I introduced() (congress.bills.billsclient method), 7 L loneno() (congress.votes.votesclient method), 7 M major() (congress.bills.billsclient method), 7 MembersClient (class in congress.members), 6 missed() (congress.votes.votesclient method), 7 N new() (congress.members.membersclient method), 6 nominations() (congress.votes.votesclient method), 7 NominationsClient (class in congress.nominations), 8 P party() (congress.members.membersclient method), 6 party() (congress.votes.votesclient method), 7 passed() (congress.bills.billsclient method), 7 perfect() (congress.votes.votesclient method), 7 R recent() (congress.bills.billsclient method), 7 T today() (congress.votes.votesclient method), 8 U upcoming() (congress.bills.billsclient method), 7 updated() (congress.bills.billsclient method), 7 V VotesClient (class in congress.votes), 7 13