A Python tool to extract information from VoxCharta My Voting Records HTML
Project description
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 Python 3.9.1, the latest version available when
developed. 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.9.1
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) python setup.py install
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:
- 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. It can be provided with the -f
or --filename
command-line flags.
$ vox_run -f /full/path/to/myvotingrecords.htm
All contents are stored in /full/path/to
. Unless -j
/--json_outfile
and
-c
/--csv_outfile
flags are provided, these are the output files are:
- JSON:
/full/path/to/myvotingrecords.json
- CSV:
/full/path/to/myvotingrecords.csv
A log file is constructed: /full/path/too/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.
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
Built Distribution
Hashes for voxcharta-my-voting-record-0.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9498a128d712954ff826261dd722d0943b7b628269ffc8d2d09dcf2aaee63813 |
|
MD5 | 880552abdda2d6c8f525e3aab337018e |
|
BLAKE2b-256 | daa0ec9702bdcdf193480846eaef3c58425980e2ae131641b39420f4d76eb33a |
Hashes for voxcharta_my_voting_record-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6de68004978d1820966b4f1b602ec0ceeebed6afc23e3ae513ae8ca4e874283 |
|
MD5 | eee29b24612f28e57ffc48e13e86a26a |
|
BLAKE2b-256 | b72ba6edce0aafb9521ba4fd1f8869b048f0264902d88d5c6f0b6fbe43afa93b |