Skip to main content

rdabase

Redistricting analytics data & shared code

Installation

To get the data locally, clone the repository:

$ git clone https://github.com/rdatools/rdabase
$ cd rdabase

To run the scripts, install the dependencies:

pip install -r requirements.txt

To use the shared code in another project, 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 17 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

Metadata

Release files for rdabase 2.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rdabase 2.6.0
File Size Uploaded Provenance Actions
rdabase-2.6.0.tar.gz 16.8 kB Without provenance Details for rdabase-2.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rdabase 2.6.0
File Interpreter ABI Platform Actions
rdabase-2.6.0-py3-none-any.whl Python 3 none any Details for rdabase-2.6.0-py3-none-any.whl

Total release size: 35.4 kB

Release files / rdabase-2.6.0.tar.gz

Download URL rdabase-2.6.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
146a40f1d78a39544e3da3531ea859541e09c5c54e57fca54940e8f58aa74351
BLAKE2b-256 checksum
How to use checksums
d74f7379d2175764a9caf9bcb7aa9bc043e85d7335499af43e30bb47702d5ef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / rdabase-2.6.0-py3-none-any.whl

Download URL rdabase-2.6.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb95ee1e3e2c2d37d44bf59dec9e279e99c9a1c830115ed74535d1d639d3f054
BLAKE2b-256 checksum
How to use checksums
8574ccc91f263859c9ae7f15a50ee8ab234c48ecde0b4e5520794db397d35b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for rdabase 2.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page