Skip to content

wl5e/stability-study-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stability Study Analyzer

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.

Features

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

Installation

Requires Python 3.8 or higher. No external dependencies.

git clone https://github.com/your-username/stability-study-analyzer
cd stability-study-analyzer

Usage

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

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

Example

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 first

Output:

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

License

MIT © 2026 Collins Amatu Gorgerat

About

Analyze pharmaceutical stability study data: fit zero-order or first-order degradation kinetics and predict shelf life.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages