semvec/pypi-packages huggingface dataset:
openmander 0.1.3
OpenMander: a redistricting toolkit in Rust with Python bindings
Requires Python: >=3.8


# 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.

```bash
python -m pip install openmander
```

## Usage

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

```python
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")
```