Skip to main content

Redistricting analytics in Python

Project description

rdapy

Redistricting analytics in Python

This repository (rdapy) re-implements the main analytics used in Dave's Redistricting, ignoring a few DRA-specific aspects (in particular, the five [0-100] ratings). Unlike the analytics used in the app (dra-analytics) which are implememented in TypeScript, these are implemented in Python.

Categories

The analytics are organized by area:

  • Compactness: Various measures of compactness
  • Equal: Population deviation
  • Graph: Checks for contiguity & embeddedness
  • Minority: Minority opportunity metrics
  • Partisan: Various measures of partisan bias & responsiveness, as well as support for rank-vote graphs and seats-votes curves
  • Splitting: County- & district-splitting and COI splitting

The samples directory contains some simple examples of how to exercies these functions and how to preprocess raw block-level data into the formats required by the analytics.

Installation

pip install rdapy

Usage

import rdapy

Automated Tests

pytest

Questions

Email questions to feedback.

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

rdapy-1.5.0.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

rdapy-1.5.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file rdapy-1.5.0.tar.gz.

File metadata

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

File hashes

Hashes for rdapy-1.5.0.tar.gz
Algorithm Hash digest
SHA256 80ff43155bcbae01483cb908fa74fee37844b3cbad0d0f5da021faa93fa8cef6
MD5 692502110e00608c0ae480e08ee71acc
BLAKE2b-256 de780f16cc6fb150f607b1d0798747a6fb25d6ff62ea408bc2f959ba06e717ce

See more details on using hashes here.

File details

Details for the file rdapy-1.5.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for rdapy-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47b0a90b6124d330740ffc2ed774835577413eb77fb117a1e6ab160e205e21be
MD5 886f6befbc0300b36b5f633d491f72e5
BLAKE2b-256 e153e4bc9d0a15c75db7ef85d8703fc13d0f0aa381fea331b6f436cc82fe62b3

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