Redistricting analytics data
Project description
rdabase
Redistricting analytics data & shared code
Installation
To get the data locally, clone the repository:
$ git clone https://github.com/alecramsay/rdabase
$ cd rdabase
To use the shared code, install the package:
$ pip install rdabase
Data
The data are stored in the data
directory by state.
These pages describe each dataset:
- Data: Census and election data by precinct.
- Shapes: Shape properties by precinct.
- Graph: Precinct adjacency graph.
At present, data for fifteen states have been extracted. In the future, we may extract data for other states.
Code
Some shared code and scripts are described here:
- Shared Code: Common code used in multiple applications.
- Scripts: Scripts to re-format the data for specific applications.
Sources
The data comes from the following sources:
- The total census population & VAP demographics data comes from the 2020_census_XX-N.csv in the DRA vtd_data GitHub repository, where XX is the state abbreviation and N is the suffix. We take the latest version of the data, which is the one with the highest N.
- The election data comes from the 2020_election_XX-N.csv in the same repo.
- The shapes are copies of tl_2020_FF_vtd20.zip from the Census Bureau, where FF is the state FIPS code, e.g., 37 for North Carolina.
Some things to be aware of:
- If it exists, we use the adjusted population data instead of the official 2020 census total population data.
- For Florida, the official VTDs from the Census Bureau are bad. We used DRA's corrected precinct shapes (GeoJSON), removed the intersections, and then converted it to a shapefile.
- We simplify the precinct shapes (see
extract_shape_data.py
) to approximate the simplification that DRA does, so compactness measurements align.
Testing
$ pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rdabase-2.1.0.tar.gz
(15.9 kB
view details)
Built Distribution
rdabase-2.1.0-py3-none-any.whl
(17.5 kB
view details)
File details
Details for the file rdabase-2.1.0.tar.gz
.
File metadata
- Download URL: rdabase-2.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4332c15e7182d1fdbb4db9b4a72be58b57b9c9ab1ad7c84c693b5376461dfd8 |
|
MD5 | 5a42a5874909e0c808d44d95897838c2 |
|
BLAKE2b-256 | 7431c33da891fca2aa6a00c72da543b7e8767fd1817b91c193fb6a1b4d14dd8d |
File details
Details for the file rdabase-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: rdabase-2.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce45b3bcda96cd1c81e09468c7e1f1896b441b90d6e4889ed69c2b70eb72bbc0 |
|
MD5 | bb44ecfe1e4525386e3fbb45b6c343fd |
|
BLAKE2b-256 | cbb43ff19e3f297e5f3b3b753a1c1ce342dcbdd366c790b86f78ef2604d2d5c9 |