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.0.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.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyvoteview-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 51048e1502ec9fd5d68472ed836bf702564b5591dad9b4ce4707bbd6163c2a51
MD5 0fb1be05b1da423b18e303208067de04
BLAKE2b-256 e69c235ac425b3ef304f8420c8b425cde1d1437d6a9337e76e0944567fe299cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvoteview-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pyvoteview-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2551b8010507e4f3f41a62bcbd74bfb005f092428628fe7d575c4440d844f6f
MD5 466136c492d4176e6d1b5f9668c0f9a7
BLAKE2b-256 e8405f532f4165edf6d8cde3c4edaf4dc533b0376c09a3b2c17039896f45be14

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvoteview-0.2.0-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