Skip to main content

Python library for GovTrack.us API

Project description

A Python wrapper for the GovTrack API (v2).

Based off of: - [https://github.com/cdelguercio/govtrack-python](https://github.com/cdelguercio/govtrack-python) - [https://github.com/markgx/govtrack-node/](https://github.com/markgx/govtrack-node/)

Installation

pip install gt-py

Usage

from gtpy.api import GTPY client = GTPY()

Choose an endpoint:

client.role() client.person() client.cosponsorship() client.vote client.bill() client.vote_voter() client.committee() client.committee_member()

Get a person:

>>>PERSON_ID = 400045 >>>client.person(PERSON_ID) {‘birthday’: ‘1952-10-20’, ‘link’: ‘https://www.govtrack.us/congress/members/jeb_bradley/400045’, ‘lastname’: ‘Bradley’…

Filter the results, such as getting all the bills voted by the 144th Congress (supports filtering on all [filterable fields](https://www.govtrack.us/developers/api)):

>>>CONGRESS_ID = 114 >>>client.bill({‘congress’: CONGRESS_ID})

Change the maximum number of results:

>>>client.bill({‘congress’: CONGRESS_ID, ‘limit’: 100})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gt-py, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size gt-py-1.2.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page