Skip to main content

PyVoteview package to process VoteView site data.

Project description

PyVoteview

PyVoteview is a Python package for programmatically accessing and analyzing U.S. Congressional voting records from Voteview. It provides a simple interface to retrieve, filter, and process roll call data for both the House and Senate across sessions and years.

Features

  • Fetch voting records by Congress number or year
  • Retrieve data for a range of sessions or years
  • Fast, parallelized data loading using Polars and ThreadPoolExecutor

Installation

PyVoteview requires Python 3.11+ and Polars:

pip install pyvoteview

Quick Start

from pyvoteview.core import get_records_by_congress, get_records_by_year

# Get House voting records for the 117th Congress
df = get_records_by_congress(117, "House")

# Get Senate voting records for the year 2020
df = get_records_by_year(2020, "Senate")

# Get records for a range of sessions
df_range = get_records_by_congress_range(115, 117, "House")

All functions return a Polars DataFrame.

API Reference

  • get_records_by_congress(number: int, chamber: Literal["House", "Senate"]) -> DataFrame
  • get_records_by_congress_range(start_congress_number int, end_congress_number int, chamber: Literal["House", "Senate"]) -> DataFrame
  • get_records_by_year(year: int, chamber: Literal["House", "Senate"]) -> DataFrame
  • get_records_by_year_range(start_year: int, end_year: int, chamber: Literal["House", "Senate"]) -> DataFrame

See pyvoteview/core.py for full documentation.

License

Licensed under the Apache License 2.0.

Acknowledgements

Data provided by Voteview

Project details


Download files

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

Source Distribution

pyvoteview-0.2.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvoteview-0.2.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file pyvoteview-0.2.1.tar.gz.

File metadata

  • Download URL: pyvoteview-0.2.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvoteview-0.2.1.tar.gz
Algorithm Hash digest
SHA256 70ba1148528c906402136dcdffb952f9942dba3d0bbbbee512efe5f71edea5cf
MD5 582ea315e3210bd0da68bcf04454acf5
BLAKE2b-256 9591260d46df555b7c2021c310f14936d262e9eac8b24f3499fdfd342e85a8ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvoteview-0.2.1.tar.gz:

Publisher: python-publish.yml on k-z-m-r/PyVoteview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvoteview-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyvoteview-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvoteview-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95ea3cad4b6ac1c976c942e9624119b39dbef24f7d76d38fc8ccbec0402c589a
MD5 22cda1e12f608961089333ce2c46995c
BLAKE2b-256 652bf9aeb161071b34c86604e7889860e6a5771f5fa7377f0fcfadefb5124f6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvoteview-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on k-z-m-r/PyVoteview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page