voxcharta-my-voting-record
Overview
This pure Python tool web scrapes data from Vox Charta's My Voting Records page. It provides the data contents in two forms, a non-relational JSON file and relational CSV file.
This software was driven by the need to archive such records since Vox Charta will be sunsetted on December 31, 2020.
Getting Started
These instructions will have the code running.
Requirements
This software is tested with 3.10.2, the latest version available during recent development.
In principle it should work with >=3.7. It requires BeautifulSoup4 and pandas.
Installation Instructions
Python and setting up an environment
Using your preferred Python environment manager (conda, virtualenv, venv),
I recommend create a separate environment to avoid any possible conflicts with
existing software that you used. Below are conda instructions
$ (sudo) conda create -n voxcharta python=3.10.2
Installation is straightforward:
$ conda activate voxcharta
$ (sudo) pip install voxcharta-my-voting-record
Or from source:
$ conda activate voxcharta
$ git clone https://github.com/astrochun/voxcharta-my-voting-record.git
$ cd voxcharta-my-voting-record
$ (sudo) pip install .
For editable/development installation, execute (sudo) pip install -e .
This is preferred over the python setup.py method as certain dependencies (numpy) will fail to install during the build process.
Vox Charta Data Export
Before using this software, you will want to export your Vox Charta My Voting Records page. Here are the steps. These are based on Chrome, so differences may occur for other browsers:
- Login to Vox Charta before you can't!
- Click on "Tools > My Voting Records"
- After the page fully loads (this can take some time), click "File > Save Page As"
- Change filename to "myvotingrecords"
- For format, select "Webpage, Complete"
Execution
The primary script to execute is vox_run
Execution requires only one argument, which is the full path to the HTML file.
$ vox_run /full/path/to/myvotingrecords.htm
This is all possible using Typer.
The script provides rich-formatted log messages to the terminal using Rich.
All contents are stored in /full/path/to unless outfile_prefix is specified
with a different path. Thus, without specifying outfile_prefix the above execution
will generate:
- JSON:
/full/path/to/myvotingrecords.json - CSV:
/full/path/to/myvotingrecords.csv
A log file is constructed: /full/path/to/vox_run.YYYY-MM-DD.log
Versioning
We use SemVer for versioning. For the versions available, see the releases on this repository.
Authors
- Chun Ly, Ph.D. (@astrochun)
License
This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.
Metadata
Release files for voxcharta-my-voting-record 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| voxcharta-my-voting-record-0.4.1.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| voxcharta_my_voting_record-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.1 kB
Release files / voxcharta-my-voting-record-0.4.1.tar.gz
| Download URL | voxcharta-my-voting-record-0.4.1.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03e4700f006ee6cc6584fe6389c9406cdf5f9ae19eeaebefee432a1200beb271
|
|
BLAKE2b-256 checksum How to use checksums |
806af6c874c96c901bff24fc1b5969fc5b2ccee8f75d12c27ae9191b7e5d6c02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / voxcharta_my_voting_record-0.4.1-py3-none-any.whl
| Download URL | voxcharta_my_voting_record-0.4.1-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64ae75f40dada66ed501079a5aea171136d5d6ce67618bbf31e943d06a2d7c46
|
|
BLAKE2b-256 checksum How to use checksums |
a4083937b0dee28fd232ab6345a4f50ffa66b49330098e100ef08973e68fdab6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|