Urn Randomizer

DOI

A clinical trial urn randomization system implementing the adaptive biased coin design described by Wei (1978). The system ensures treatment-group balance according to one or more prognostic factors and exposes its functionality through a Flask web GUI, a REST API, and a command-line interface.

Dashboard screenshot

Getting Started

Install the package, configure a study, and run your first randomization.

Quick Start
Web Dashboard

Monitor enrollment progress, treatment balance, and assignment history through the interactive web interface.

Web Dashboard
REST API

Integrate randomization into existing platforms using the HTTP API.

REST API
Python API Examples

Step-by-step Python examples for querying, randomizing, and batch operations.

Python API Examples
CLI Reference

Manage users, randomize participants, and export data from the terminal.

CLI Reference
Plugin System

Customize assignment logic with Python plugins that run after each urn draw.

Plugin System
Reproducibility

How seed management and the PCG64 generator ensure deterministic, auditable assignment sequences.

Reproducibility
Why Urn Randomization?

Monte Carlo evidence showing how urn randomization reduces treatment imbalance compared to complete randomization.

Why Urn Randomization?

Key Features

  • Urn randomization per Wei (1978) adaptive biased coin design

  • Interactive dashboard with enrollment progress, Bokeh charts, and data export

  • REST API with API-key authentication for programmatic access

  • CLI for scripting and batch operations

  • Plugin system for custom assignment logic

  • Reproducible RNG via NumPy PCG64 generator

  • SQLite storage for portable, zero-configuration persistence

Tip

Try the live demo — no login required. The demo is pre-seeded with 25 participants across three treatment arms.