Urn Randomizer¶
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.
Install the package, configure a study, and run your first randomization.
Monitor enrollment progress, treatment balance, and assignment history through the interactive web interface.
Integrate randomization into existing platforms using the HTTP API.
Step-by-step Python examples for querying, randomizing, and batch operations.
Manage users, randomize participants, and export data from the terminal.
Customize assignment logic with Python plugins that run after each urn draw.
How seed management and the PCG64 generator ensure deterministic, auditable assignment sequences.
Monte Carlo evidence showing how urn randomization reduces treatment imbalance compared to complete 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.