Skip to main content

OpenMander: a redistricting toolkit in Rust with Python bindings

Project description

Openmander Python Bindings

This directory contains the Python bindings for Openmander.

Installation

To install the Openmander Python bindings, you can use pip. Make sure you have Python ≥ 3.8 and pip installed on your system.

python -m pip install openmander

Usage

Once installed, you can import the Openmander module in your Python scripts and start using its features.

import openmander as om

# Download state pack for Illinois
pack_path = om.download("IL")
IL_map = om.Map(pack_path)
plan = om.Plan(IL_map, num_districts=17)

# Generate a random configuration of 17 districts.
plan.randomize()

# Balance the total population of each district.
plan.equalize("T_20_CENS_Total", tolerance=0.002, max_iter=1000)

# Output the block assignments to a csv file.
plan.to_csv("IL-block-assign.csv")

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openmander-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (23.2 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file openmander-0.1.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for openmander-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4924e2d23103d65b0a4d48116bc8fa14f40f26445e53638b4646f827728b0d89
MD5 d141894219e513a5b048a9e6f98c1209
BLAKE2b-256 415a816ee65bbaa6e4f11bf7d4b2f78274d80e57eefb24541f8b126196dd8226

See more details on using hashes here.

Supported by

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