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.12+ 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.1.0.tar.gz (7.8 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.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyvoteview-0.1.0.tar.gz
Algorithm Hash digest
SHA256 994015446a81cd6add0f1de83575bfb0860af2916ec95f184631011fc03955a1
MD5 ca3b6156d284425d54c84c762fca7416
BLAKE2b-256 e1997cec30e57bb23227d98f5f11678790a50fb49c694f1878a9e5b444a94341

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvoteview-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eed0142a7b75840e8b1ea938143888e5f5999f34d84f271ec40b4c1c643058a5
MD5 d98369cd4d3a059f78715cffaa6135ef
BLAKE2b-256 fc1495774d93d7d3dfa207825d1f6d03af2b83e04fabf5eea92f4008df62a5d6

See more details on using hashes here.

Provenance

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