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.1.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

rdapy-1.5.1-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rdapy-1.5.1.tar.gz
  • Upload date:
  • Size: 45.1 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.1.tar.gz
Algorithm Hash digest
SHA256 2e796dfd5c6bdb82f8e7f5e933b7945974f4ba38c4492f4e86c7bb302351c0a0
MD5 1e74e0bbebcd444e63fb4a5017065529
BLAKE2b-256 40ddb432bddfa68e1931464e0f980a862dd7922889571e8e7822b58cae7c3e3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rdapy-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 34.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83200d4bfdfea02cdcc40302c02148be8811d5010f225b8035e0b40a351d1c2d
MD5 ad44206fae2c2085f7fa43d8e155c5b7
BLAKE2b-256 89a05462adeb696e8cf2386906684944f64ec0c78ff697ff049eda133717a56d

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