SPC charts and QI tools for healthcare
Project description
qikit
SPC charts and quality improvement tools for healthcare, in Python.
One function. One result object. One .plot() call.
Install
pip install clinical-qikit
Quickstart
from qikit import qic
result = qic(y=values, chart="i")
result.plot() # returns a Plotly figure
qic() mirrors R's qicharts2, the package most
healthcare QI practitioners already know — same chart types, same run-chart signal
detection, same mental model, now in Python.
Chart types
All chart types are computed by the same qic() entry point via the chart= argument:
chart= |
Chart | Use for |
|---|---|---|
run |
Run chart | Any sequential data, median center line |
i |
Individuals (I) chart | Continuous data, one observation per subgroup |
mr |
Moving range | Variation between consecutive observations |
xbar |
X-bar chart | Continuous data with subgroups (paired with s) |
s |
S chart | Subgroup standard deviation |
t |
Time-between-events chart | Time or count between rare events |
p |
P chart | Proportion (percent) defective, unequal subgroup sizes |
pp |
P′ (Laney) chart | Proportion data with overdispersion |
c |
C chart | Count of defects, constant opportunity |
u |
U chart | Rate of defects, unequal opportunity |
up |
U′ (Laney) chart | Rate data with overdispersion |
g |
G chart | Number of opportunities between rare events |
qic(..., funnel=True) renders a funnel plot instead, for cross-sectional comparison
across p/pp/u/up charts sorted by denominator.
Beyond qic(), the package also provides:
paretochart(x, data=...)— Pareto chart of categorical frequencies.bchart(...)— Bernoulli CUSUM chart for early detection of shifts in binary (pass/fail) data.design(factors, ...)/analyze(design_obj, response, ...)— full-factorial design of experiments (DOE) and effect analysis.
Excel add-in
A Microsoft Excel task-pane add-in built on the same charting engine (ported to
TypeScript) lives in excel-addin/ — see its
README for dev-harness and sideload instructions, and
docs/excel-addin-roadmap.md for the roadmap.
Web app
app.py is a Streamlit front end over the same engine:
pip install -e .[app]
streamlit run app.py
Development
uv sync --extra dev
uv run ruff check . # lint (CI-enforced)
uv run pytest tests/ # 176 tests incl. cross-language fixture conformance
The Python engine is authoritative; the TypeScript port in
excel-addin/packages/engine conforms to it via the shared JSON fixtures in
fixtures/. After intentional engine changes, regenerate the
fixture snapshots with uv run python scripts/update_snapshots.py.
References
- Montgomery DC. Introduction to Statistical Quality Control, 8th ed. Wiley, 2019.
- Provost LP, Murray SK. The Health Care Data Guide, 2nd ed. Jossey-Bass, 2022.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clinical_qikit-0.1.2.tar.gz.
File metadata
- Download URL: clinical_qikit-0.1.2.tar.gz
- Upload date:
- Size: 270.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10e14fd96bc73b06419c5916555a37b7c863b029add9ed2119dbc96afe0d7ebd
|
|
| MD5 |
39bf1dbf53cd00e8b64d7b7619075079
|
|
| BLAKE2b-256 |
13d9d3a9ceec05f0986c03165a35daf8403b034639a38235c732418b314eb5db
|
File details
Details for the file clinical_qikit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: clinical_qikit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c80b2af98d564d9088df5bc7026b83ea234b53c0fc671b00c4e673a5a4673333
|
|
| MD5 |
a42d3da8255b6475ce36d73461b8b68b
|
|
| BLAKE2b-256 |
c7bd6c55820146972171a31c3fb1f1327834f5276c094dc5d3c497a0489cf3bc
|