Skip to main content

Redistricting analytics data

Project description

rdadata

Redistricting analytics data & shared code

Installation

To get the data locally, clone the repository:

$ git clone https://github.com/alecramsay/rdadata
$ cd rdadata

To use the shared code, install the package:

$ pip install rdadata

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rdadata-1.2.2.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

rdadata-1.2.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file rdadata-1.2.2.tar.gz.

File metadata

  • Download URL: rdadata-1.2.2.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for rdadata-1.2.2.tar.gz
Algorithm Hash digest
SHA256 108d6d7cfcb264ab66421fef54980c4455f3ccb509a6d6a9f42fef0a7b1859d4
MD5 13a2f053439ba324a3b0e241a87f411f
BLAKE2b-256 eb7778f7bf7dc4de414b6da312beb3e641ccab0e1791adab42c6a7d1dbb73328

See more details on using hashes here.

File details

Details for the file rdadata-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: rdadata-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for rdadata-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b49489e2938705a9c2aeedb5c34a961cc88434afdbdb3cbf6eee06606d388c0
MD5 85ac36056da2ee42695af4eace7deda3
BLAKE2b-256 9e2613b03135b0310ea389e779686e32d7d0cd768a181b2e56c2fd4ca467f417

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page