Metadata-Version: 2.4
Name: edgar_design
Version: 1.0.0
Summary: Modern Python implementation of EDGAR – Experimental Design Generator and Randomiser
Project-URL: Homepage, https://github.com/rotsl/edgar
Project-URL: Repository, https://github.com/rotsl/edgar
Project-URL: Issues, https://github.com/rotsl/edgar/issues
Author: rRohan R
License-Expression: MIT
License-File: LICENSE
Keywords: agriculture,edgar,experimental-design,randomisation,statistics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: click>=8.0
Requires-Dist: fastapi>=0.104
Requires-Dist: jinja2>=3.1
Requires-Dist: markdown>=3.4
Requires-Dist: openpyxl>=3.1
Requires-Dist: pydantic>=2.0
Requires-Dist: uvicorn[standard]>=0.24
Provides-Extra: dev
Requires-Dist: httpx>=0.25; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# EDGAR — Experimental Design Generator and Randomiser

A modern Python implementation of **EDGAR**, originally developed as Excel/VBA workbooks by the Biometrics team at [Rothamsted Research](https://www.edgarweb.org.uk). This package replaces legacy macro-driven workbooks with a deterministic, reproducible, fully tested Python system.

## Supported Designs

| Key | Design |
|-----|--------|
| `cr_eq` | Completely Randomised — Equal Replication |
| `cr_uneq` | Completely Randomised — Unequal Replication |
| `rcb` | Randomised Complete Block |
| `rcb_uneq` | RCB — Unequal Replication |
| `two_factor_rcb` | Two-Factor RCB |
| `latin` | Latin Square |
| `split_plot` | Split Plot |
| `variable_blocks` | Variable Block Sizes |
| `alpha` | Alpha Design (Patterson & Williams, 1976) |

## Installation

```bash
pip install edgar_design
```

## Quick Start

### Command-line

```bash
# List all design types
edgar-design list-designs

# Generate an RCB design
edgar-design generate rcb --treatment-count 8 --block-count 4 --seed 42 --format csv

# Generate an alpha design as XLSX
edgar-design generate alpha --treatment-count 30 --reps 3 --blocks-per-replicate 6 --seed 1 --format xlsx -o design.xlsx
```

### Web interface

```bash
uvicorn edgar_design.api.main:app --reload --host 0.0.0.0 --port 8000
# Open http://localhost:8000
```

A read-only static preview is available at **https://rotsl.github.io/edgar/**.

### Python API

```python
from edgar_design.designs import generate_design

result = generate_design("rcb", treatment_count=4, block_count=3, seed=42)
for row in result.rows:
    print(row)
```

## Key Features

- **Deterministic** — `random.Random(seed)` ensures same seed always gives same design
- **9 design types** — covers the most common agricultural and industrial experiment structures
- **Three interfaces** — web UI, CLI (`edgar-design`), and Python API
- **Multiple export formats** — CSV, JSON, XLSX (with metadata, matching legacy workbook layout)
- **229 tests**, 94–100% coverage on core modules
- **No Excel required** — pure Python, runs on any OS

## Links

- **Repository:** https://github.com/rotsl/edgar
- **Full documentation:** https://github.com/rotsl/edgar/blob/main/README.md
- **Issue tracker:** https://github.com/rotsl/edgar/issues
- **Original Excel workbooks:** https://www.edgarweb.org.uk

## License

Copyright © 2026 rotsl. MIT License.
