A command-line tool for analysing pharmaceutical stability study data. Fits zero‑order and first‑order degradation models, calculates kinetic parameters, half‑life, and predicts shelf life based on a user‑specified acceptance criterion.
- Load stability data from CSV files (time and concentration columns).
- Support for zero‑order (linear) and first‑order (exponential) degradation kinetics.
- Perform linear regression using ordinary least squares.
- Compute rate constant, initial concentration, R², half‑life, and shelf life.
- Configurable acceptance limit (default 90% of initial concentration).
- Robust handling of missing / non‑positive values for first‑order fitting.
- GMP‑friendly clean output suitable for inclusion in regulatory reports.
Requires Python 3.8 or higher. No external dependencies.
git clone https://github.com/your-username/stability-study-analyzer
cd stability-study-analyzer# Zero‑order degradation
python stability_analyzer.py data.csv --model zero
# First‑order degradation with custom acceptance limit
python stability_analyzer.py data.csv --model first --limit 95
# Specify column names and delimiter
python stability_analyzer.py data.tsv --time-col Month --conc-col Purity --delimiter tabInput CSV must contain at least a time column and a concentration column. The default column names are time and concentration. The default delimiter is comma.
Sample data.csv:
time,concentration
0,100.2
1,98.1
2,95.8
3,93.9
Command:
python stability_analyzer.py data.csv --model firstOutput:
--- Stability Analysis Report ---
Model: first-order
Rate constant (k): 0.0214 month⁻¹
Initial conc (C₀): 100.15
R²: 0.9998
Half‑life: 32.4 months
Shelf life (90.0%): 4.9 months
MIT © 2026 Collins Amatu Gorgerat