starlibpy 0.3.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- starlibpy-0.3.0b2/ACKNOWLEDGMENTS.md +11 -0
- starlibpy-0.3.0b2/AUTHORS.md +17 -0
- starlibpy-0.3.0b2/BUILD_MANIFEST.md +58 -0
- starlibpy-0.3.0b2/CHANGELOG.md +55 -0
- starlibpy-0.3.0b2/CITATION.cff +26 -0
- starlibpy-0.3.0b2/LICENSE +21 -0
- starlibpy-0.3.0b2/MANIFEST.in +6 -0
- starlibpy-0.3.0b2/PKG-INFO +303 -0
- starlibpy-0.3.0b2/README.md +231 -0
- starlibpy-0.3.0b2/REFERENCES.bib +176 -0
- starlibpy-0.3.0b2/TEST_REPORT.md +75 -0
- starlibpy-0.3.0b2/THIRD_PARTY_LICENSES.md +26 -0
- starlibpy-0.3.0b2/VERSION +1 -0
- starlibpy-0.3.0b2/docs/API_INVENTORY.md +645 -0
- starlibpy-0.3.0b2/docs/API_OVERVIEW.md +57 -0
- starlibpy-0.3.0b2/docs/ARCHITECTURE.md +55 -0
- starlibpy-0.3.0b2/docs/DEPENDENCIES.md +69 -0
- starlibpy-0.3.0b2/docs/DOCSTRING_TEMPLATE.py +54 -0
- starlibpy-0.3.0b2/docs/EXTENSIONS.md +44 -0
- starlibpy-0.3.0b2/docs/IMPLEMENTATION_STATUS.md +48 -0
- starlibpy-0.3.0b2/docs/MIGRATION.md +28 -0
- starlibpy-0.3.0b2/examples/plugin.py +19 -0
- starlibpy-0.3.0b2/examples/quickstart.py +28 -0
- starlibpy-0.3.0b2/examples/study_design.py +42 -0
- starlibpy-0.3.0b2/pyproject.toml +131 -0
- starlibpy-0.3.0b2/setup.cfg +4 -0
- starlibpy-0.3.0b2/src/starlibpy/__init__.py +802 -0
- starlibpy-0.3.0b2/src/starlibpy/_metadata.py +8 -0
- starlibpy-0.3.0b2/src/starlibpy/_version.py +3 -0
- starlibpy-0.3.0b2/src/starlibpy/agreement/__init__.py +19 -0
- starlibpy-0.3.0b2/src/starlibpy/agreement/core.py +405 -0
- starlibpy-0.3.0b2/src/starlibpy/anova/__init__.py +25 -0
- starlibpy-0.3.0b2/src/starlibpy/anova/core.py +521 -0
- starlibpy-0.3.0b2/src/starlibpy/association/__init__.py +15 -0
- starlibpy-0.3.0b2/src/starlibpy/association/core.py +308 -0
- starlibpy-0.3.0b2/src/starlibpy/assumptions/__init__.py +39 -0
- starlibpy-0.3.0b2/src/starlibpy/assumptions/core.py +807 -0
- starlibpy-0.3.0b2/src/starlibpy/clinical/__init__.py +33 -0
- starlibpy-0.3.0b2/src/starlibpy/clinical/adverse_events.py +474 -0
- starlibpy-0.3.0b2/src/starlibpy/clinical/recist.py +307 -0
- starlibpy-0.3.0b2/src/starlibpy/colors/__init__.py +49 -0
- starlibpy-0.3.0b2/src/starlibpy/colors/core.py +426 -0
- starlibpy-0.3.0b2/src/starlibpy/comparisons/__init__.py +31 -0
- starlibpy-0.3.0b2/src/starlibpy/comparisons/core.py +903 -0
- starlibpy-0.3.0b2/src/starlibpy/data/__init__.py +95 -0
- starlibpy-0.3.0b2/src/starlibpy/data/_utils.py +404 -0
- starlibpy-0.3.0b2/src/starlibpy/data/analysis_dataset.py +351 -0
- starlibpy-0.3.0b2/src/starlibpy/data/audit.py +161 -0
- starlibpy-0.3.0b2/src/starlibpy/data/constants.py +100 -0
- starlibpy-0.3.0b2/src/starlibpy/data/imputation.py +552 -0
- starlibpy-0.3.0b2/src/starlibpy/data/missingness.py +574 -0
- starlibpy-0.3.0b2/src/starlibpy/data/models.py +336 -0
- starlibpy-0.3.0b2/src/starlibpy/data/profiling.py +293 -0
- starlibpy-0.3.0b2/src/starlibpy/data/py.typed +0 -0
- starlibpy-0.3.0b2/src/starlibpy/data/repeated.py +426 -0
- starlibpy-0.3.0b2/src/starlibpy/data/transformations.py +825 -0
- starlibpy-0.3.0b2/src/starlibpy/data/validation.py +695 -0
- starlibpy-0.3.0b2/src/starlibpy/descriptive/__init__.py +27 -0
- starlibpy-0.3.0b2/src/starlibpy/descriptive/core.py +827 -0
- starlibpy-0.3.0b2/src/starlibpy/design/__init__.py +141 -0
- starlibpy-0.3.0b2/src/starlibpy/design/_utils.py +112 -0
- starlibpy-0.3.0b2/src/starlibpy/design/analysis.py +987 -0
- starlibpy-0.3.0b2/src/starlibpy/design/constants.py +211 -0
- starlibpy-0.3.0b2/src/starlibpy/design/inference.py +415 -0
- starlibpy-0.3.0b2/src/starlibpy/design/io.py +69 -0
- starlibpy-0.3.0b2/src/starlibpy/design/models.py +487 -0
- starlibpy-0.3.0b2/src/starlibpy/design/py.typed +0 -0
- starlibpy-0.3.0b2/src/starlibpy/design/reports.py +229 -0
- starlibpy-0.3.0b2/src/starlibpy/design/specs.py +319 -0
- starlibpy-0.3.0b2/src/starlibpy/design/study.py +333 -0
- starlibpy-0.3.0b2/src/starlibpy/design/validation.py +817 -0
- starlibpy-0.3.0b2/src/starlibpy/diagnostic/__init__.py +25 -0
- starlibpy-0.3.0b2/src/starlibpy/diagnostic/core.py +625 -0
- starlibpy-0.3.0b2/src/starlibpy/effect_sizes/__init__.py +19 -0
- starlibpy-0.3.0b2/src/starlibpy/effect_sizes/core.py +218 -0
- starlibpy-0.3.0b2/src/starlibpy/equivalence/__init__.py +21 -0
- starlibpy-0.3.0b2/src/starlibpy/equivalence/core.py +300 -0
- starlibpy-0.3.0b2/src/starlibpy/estimation/__init__.py +37 -0
- starlibpy-0.3.0b2/src/starlibpy/estimation/core.py +636 -0
- starlibpy-0.3.0b2/src/starlibpy/exceptions.py +25 -0
- starlibpy-0.3.0b2/src/starlibpy/legacy.py +110 -0
- starlibpy-0.3.0b2/src/starlibpy/longitudinal/__init__.py +17 -0
- starlibpy-0.3.0b2/src/starlibpy/longitudinal/core.py +460 -0
- starlibpy-0.3.0b2/src/starlibpy/multiplicity/__init__.py +15 -0
- starlibpy-0.3.0b2/src/starlibpy/multiplicity/core.py +161 -0
- starlibpy-0.3.0b2/src/starlibpy/plugins/__init__.py +21 -0
- starlibpy-0.3.0b2/src/starlibpy/plugins/registry.py +76 -0
- starlibpy-0.3.0b2/src/starlibpy/py.typed +0 -0
- starlibpy-0.3.0b2/src/starlibpy/regression/__init__.py +33 -0
- starlibpy-0.3.0b2/src/starlibpy/regression/core.py +628 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/__init__.py +185 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/annotations.py +65 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/exporters.py +115 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/plots.py +849 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/registry.py +38 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/reports.py +71 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/tables.py +309 -0
- starlibpy-0.3.0b2/src/starlibpy/reporting/templates.py +138 -0
- starlibpy-0.3.0b2/src/starlibpy/resampling/__init__.py +25 -0
- starlibpy-0.3.0b2/src/starlibpy/resampling/core.py +295 -0
- starlibpy-0.3.0b2/src/starlibpy/results/__init__.py +247 -0
- starlibpy-0.3.0b2/src/starlibpy/results/base.py +360 -0
- starlibpy-0.3.0b2/src/starlibpy/results/types.py +244 -0
- starlibpy-0.3.0b2/src/starlibpy/survival/__init__.py +39 -0
- starlibpy-0.3.0b2/src/starlibpy/survival/core.py +848 -0
- starlibpy-0.3.0b2/src/starlibpy/utils.py +35 -0
- starlibpy-0.3.0b2/src/starlibpy.egg-info/PKG-INFO +303 -0
- starlibpy-0.3.0b2/src/starlibpy.egg-info/SOURCES.txt +121 -0
- starlibpy-0.3.0b2/src/starlibpy.egg-info/dependency_links.txt +1 -0
- starlibpy-0.3.0b2/src/starlibpy.egg-info/requires.txt +53 -0
- starlibpy-0.3.0b2/src/starlibpy.egg-info/top_level.txt +1 -0
- starlibpy-0.3.0b2/tests/test_anova_longitudinal_regression.py +120 -0
- starlibpy-0.3.0b2/tests/test_assumptions_effects_resampling_equivalence.py +114 -0
- starlibpy-0.3.0b2/tests/test_clinical.py +83 -0
- starlibpy-0.3.0b2/tests/test_colors_reporting_plugins.py +62 -0
- starlibpy-0.3.0b2/tests/test_comparisons_association.py +53 -0
- starlibpy-0.3.0b2/tests/test_data.py +433 -0
- starlibpy-0.3.0b2/tests/test_design.py +347 -0
- starlibpy-0.3.0b2/tests/test_design_data_integration.py +84 -0
- starlibpy-0.3.0b2/tests/test_diagnostic_survival_agreement.py +101 -0
- starlibpy-0.3.0b2/tests/test_estimation_descriptive.py +77 -0
- starlibpy-0.3.0b2/tests/test_extended_analyses.py +128 -0
- starlibpy-0.3.0b2/tests/test_import_api.py +35 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Acknowledgments
|
|
2
|
+
|
|
3
|
+
Starlibpy is built on the Python scientific ecosystem. The project acknowledges
|
|
4
|
+
the authors, maintainers, and contributors of Python, NumPy, pandas, SciPy,
|
|
5
|
+
statsmodels, Patsy, scikit-learn, Matplotlib, Jinja2, lifelines,
|
|
6
|
+
scikit-posthocs, PyYAML, openpyxl, python-docx, Pillow, webcolors, and PyArrow.
|
|
7
|
+
|
|
8
|
+
Attribution to an upstream project does not imply that its authors created,
|
|
9
|
+
reviewed, endorsed, or assume responsibility for Starlibpy. Statistical and
|
|
10
|
+
clinical users remain responsible for verifying that the chosen method matches
|
|
11
|
+
their protocol, estimand, data-generating process, and applicable guidance.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Authors and contributors
|
|
2
|
+
|
|
3
|
+
## Project creator and principal author
|
|
4
|
+
|
|
5
|
+
**Dr. M.A. Melzi, MD**
|
|
6
|
+
|
|
7
|
+
Creator of **Starlibpy — Statistical Tools for Academic Research Library**;
|
|
8
|
+
author of its scientific architecture, public API, integration logic, result-object
|
|
9
|
+
system, reporting conventions, and Starlibpy-specific implementation.
|
|
10
|
+
|
|
11
|
+
## Future contributors
|
|
12
|
+
|
|
13
|
+
Contributors should be listed by contribution type: source code, statistical
|
|
14
|
+
validation, clinical review, documentation, testing, translations, or maintenance.
|
|
15
|
+
Upstream-library authors retain authorship of their respective projects and are
|
|
16
|
+
credited separately in `ACKNOWLEDGMENTS.md`, `REFERENCES.bib`, and
|
|
17
|
+
`THIRD_PARTY_LICENSES.md`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Build manifest
|
|
2
|
+
|
|
3
|
+
**Project:** Starlibpy — Statistical Tools for Academic Research Library
|
|
4
|
+
**Version:** 0.3.0b2
|
|
5
|
+
**Project author:** Dr. M.A. Melzi, MD
|
|
6
|
+
**Recommended import:** `import starlibpy as slp`
|
|
7
|
+
|
|
8
|
+
## Source composition
|
|
9
|
+
|
|
10
|
+
| Item | Count |
|
|
11
|
+
|---|---:|
|
|
12
|
+
| Python source files | 77 |
|
|
13
|
+
| Source lines | 22251 |
|
|
14
|
+
| Root-level public API symbols | 364 |
|
|
15
|
+
| Public functions declared by submodules | 364 |
|
|
16
|
+
| Public classes declared by submodules | 59 |
|
|
17
|
+
| Public constants declared by submodules | 57 |
|
|
18
|
+
| Test files | 12 |
|
|
19
|
+
| Executable examples | 3 |
|
|
20
|
+
| Automated tests passing | 95 |
|
|
21
|
+
|
|
22
|
+
## Packaged submodules
|
|
23
|
+
|
|
24
|
+
- `starlibpy.agreement`
|
|
25
|
+
- `starlibpy.anova`
|
|
26
|
+
- `starlibpy.association`
|
|
27
|
+
- `starlibpy.assumptions`
|
|
28
|
+
- `starlibpy.clinical`
|
|
29
|
+
- `starlibpy.colors`
|
|
30
|
+
- `starlibpy.comparisons`
|
|
31
|
+
- `starlibpy.data`
|
|
32
|
+
- `starlibpy.descriptive`
|
|
33
|
+
- `starlibpy.design`
|
|
34
|
+
- `starlibpy.diagnostic`
|
|
35
|
+
- `starlibpy.effect_sizes`
|
|
36
|
+
- `starlibpy.equivalence`
|
|
37
|
+
- `starlibpy.estimation`
|
|
38
|
+
- `starlibpy.longitudinal`
|
|
39
|
+
- `starlibpy.multiplicity`
|
|
40
|
+
- `starlibpy.plugins`
|
|
41
|
+
- `starlibpy.regression`
|
|
42
|
+
- `starlibpy.reporting`
|
|
43
|
+
- `starlibpy.resampling`
|
|
44
|
+
- `starlibpy.results`
|
|
45
|
+
- `starlibpy.survival`
|
|
46
|
+
|
|
47
|
+
## Distribution contents
|
|
48
|
+
|
|
49
|
+
- PEP 517/518 `pyproject.toml` configuration;
|
|
50
|
+
- MIT license and third-party license inventory;
|
|
51
|
+
- `CITATION.cff`, authorship, acknowledgments and references;
|
|
52
|
+
- source package under `src/starlibpy`;
|
|
53
|
+
- typed marker `py.typed`;
|
|
54
|
+
- automated tests and executable examples;
|
|
55
|
+
- architecture, API, dependency, extension, migration and status documents;
|
|
56
|
+
- wheel and source distribution generated from this tree.
|
|
57
|
+
|
|
58
|
+
Cryptographic hashes are provided separately in `SHA256SUMS.txt`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.0b2 — 2026-08-26
|
|
4
|
+
|
|
5
|
+
Publication-candidate cleanup of the 0.3.0 beta architecture.
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Replaced root and internal star imports with explicit public APIs.
|
|
10
|
+
- Preserved the 364-symbol root API used by `import starlibpy as slp`.
|
|
11
|
+
- Centralized the build version in `starlibpy._version`.
|
|
12
|
+
- Modernized imports, annotations, UTC handling, and code formatting.
|
|
13
|
+
- Removed unused imports and resolved all Ruff warnings.
|
|
14
|
+
- Raised the minimum setuptools build backend to 77.0.3 for PEP 639 license metadata support.
|
|
15
|
+
|
|
16
|
+
### Validation
|
|
17
|
+
|
|
18
|
+
- `python -m ruff check src tests`: passed.
|
|
19
|
+
- `python -m ruff format --check src tests`: passed.
|
|
20
|
+
- `python -m pytest -q`: 95 tests passed.
|
|
21
|
+
- `python -m pip check`: no broken requirements.
|
|
22
|
+
|
|
23
|
+
## 0.3.0b1 — 2026-08-24
|
|
24
|
+
|
|
25
|
+
Complete architectural replacement of the former flat package.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Canonical identity: **Starlibpy — Statistical Tools for Academic Research Library**.
|
|
30
|
+
- Recommended import: `import starlibpy as slp`.
|
|
31
|
+
- Typed scientific result objects (`StarResult`, `StarTable`, `StarFigure`).
|
|
32
|
+
- Study and analysis design objects with validation and provenance.
|
|
33
|
+
- Data profiling, quality checks, missing-data analysis, preparation, and audit.
|
|
34
|
+
- Descriptive statistics, estimation, assumptions, test recommendation, comparisons,
|
|
35
|
+
correlations, ANOVA, longitudinal models, regression, diagnostic accuracy,
|
|
36
|
+
survival, agreement, multiplicity, resampling, equivalence, and non-inferiority.
|
|
37
|
+
- Clinical adverse-event analyses and an explicitly experimental target-lesion
|
|
38
|
+
RECIST 1.1 component.
|
|
39
|
+
- Automatic publication-table and plot rendering.
|
|
40
|
+
- Accessible color palettes, contrast validation, themes, and palette generation.
|
|
41
|
+
- Plugin registry and `starlibpy.plugins` entry-point loading for complementary modules.
|
|
42
|
+
- Optional dependency groups and reproducibility metadata.
|
|
43
|
+
- Deprecation wrappers for selected former public names.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- Calculation, rendering, and export are separate responsibilities.
|
|
48
|
+
- Optional analysis engines no longer prevent package import.
|
|
49
|
+
- Numerical outputs remain unrounded until the reporting layer.
|
|
50
|
+
|
|
51
|
+
### Removed from the stable API
|
|
52
|
+
|
|
53
|
+
- Implicit printing, plotting, or file writing from statistical functions.
|
|
54
|
+
- Silent outlier deletion.
|
|
55
|
+
- Duplicate statistical primitives and versioned public function names.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use Starlibpy, cite this software and the upstream scientific libraries used by your analysis."
|
|
3
|
+
title: "Starlibpy: Statistical Tools for Academic Research Library"
|
|
4
|
+
type: software
|
|
5
|
+
version: "0.3.0b2"
|
|
6
|
+
date-released: 2026-08-26
|
|
7
|
+
authors:
|
|
8
|
+
- family-names: Melzi
|
|
9
|
+
given-names: M. A.
|
|
10
|
+
name-suffix: MD
|
|
11
|
+
license: MIT
|
|
12
|
+
repository-code: "https://github.com/mamelzi/starlibpy"
|
|
13
|
+
url: "https://github.com/mamelzi/starlibpy"
|
|
14
|
+
abstract: >-
|
|
15
|
+
Starlibpy is a modular Python library for study-design specification,
|
|
16
|
+
data quality, statistical analysis, diagnostics, scientific visualization,
|
|
17
|
+
and publication-ready reporting in academic, clinical, epidemiological,
|
|
18
|
+
and biomedical research.
|
|
19
|
+
keywords:
|
|
20
|
+
- statistics
|
|
21
|
+
- academic research
|
|
22
|
+
- biomedical research
|
|
23
|
+
- clinical research
|
|
24
|
+
- epidemiology
|
|
25
|
+
- survival analysis
|
|
26
|
+
- diagnostic accuracy
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dr. M.A. Melzi, MD
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
include README.md LICENSE CITATION.cff AUTHORS.md ACKNOWLEDGMENTS.md REFERENCES.bib THIRD_PARTY_LICENSES.md CHANGELOG.md TEST_REPORT.md BUILD_MANIFEST.md VERSION
|
|
2
|
+
recursive-include docs *.md *.py
|
|
3
|
+
recursive-include examples *.py
|
|
4
|
+
recursive-include src/starlibpy py.typed
|
|
5
|
+
|
|
6
|
+
recursive-include tests *.py
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: starlibpy
|
|
3
|
+
Version: 0.3.0b2
|
|
4
|
+
Summary: Statistical Tools for Academic Research Library
|
|
5
|
+
Author: Dr. M.A. Melzi, MD
|
|
6
|
+
Maintainer: Dr. M.A. Melzi, MD
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/mamelzi/starlibpy
|
|
9
|
+
Project-URL: Repository, https://github.com/mamelzi/starlibpy
|
|
10
|
+
Project-URL: Issues, https://github.com/mamelzi/starlibpy/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/mamelzi/starlibpy/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: statistics,academic research,biomedical research,clinical research,epidemiology,survival analysis,diagnostic accuracy,publication reporting
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: numpy>=1.26
|
|
27
|
+
Requires-Dist: pandas>=2.1
|
|
28
|
+
Requires-Dist: scipy>=1.11
|
|
29
|
+
Requires-Dist: statsmodels>=0.14
|
|
30
|
+
Requires-Dist: patsy>=0.5.6
|
|
31
|
+
Provides-Extra: data
|
|
32
|
+
Requires-Dist: scikit-learn>=1.3; extra == "data"
|
|
33
|
+
Requires-Dist: openpyxl>=3.1; extra == "data"
|
|
34
|
+
Requires-Dist: PyYAML>=6.0; extra == "data"
|
|
35
|
+
Requires-Dist: pyarrow>=14; extra == "data"
|
|
36
|
+
Provides-Extra: plotting
|
|
37
|
+
Requires-Dist: matplotlib>=3.8; extra == "plotting"
|
|
38
|
+
Provides-Extra: diagnostic
|
|
39
|
+
Requires-Dist: scikit-learn>=1.3; extra == "diagnostic"
|
|
40
|
+
Provides-Extra: reporting
|
|
41
|
+
Requires-Dist: matplotlib>=3.8; extra == "reporting"
|
|
42
|
+
Requires-Dist: Jinja2>=3.1; extra == "reporting"
|
|
43
|
+
Requires-Dist: openpyxl>=3.1; extra == "reporting"
|
|
44
|
+
Requires-Dist: python-docx>=1.1; extra == "reporting"
|
|
45
|
+
Requires-Dist: Pillow>=10; extra == "reporting"
|
|
46
|
+
Requires-Dist: webcolors>=24; extra == "reporting"
|
|
47
|
+
Provides-Extra: survival
|
|
48
|
+
Requires-Dist: lifelines>=0.29; extra == "survival"
|
|
49
|
+
Provides-Extra: posthoc
|
|
50
|
+
Requires-Dist: scikit-posthocs>=0.9; extra == "posthoc"
|
|
51
|
+
Provides-Extra: full
|
|
52
|
+
Requires-Dist: scikit-learn>=1.3; extra == "full"
|
|
53
|
+
Requires-Dist: matplotlib>=3.8; extra == "full"
|
|
54
|
+
Requires-Dist: Jinja2>=3.1; extra == "full"
|
|
55
|
+
Requires-Dist: openpyxl>=3.1; extra == "full"
|
|
56
|
+
Requires-Dist: python-docx>=1.1; extra == "full"
|
|
57
|
+
Requires-Dist: Pillow>=10; extra == "full"
|
|
58
|
+
Requires-Dist: webcolors>=24; extra == "full"
|
|
59
|
+
Requires-Dist: PyYAML>=6.0; extra == "full"
|
|
60
|
+
Requires-Dist: pyarrow>=14; extra == "full"
|
|
61
|
+
Requires-Dist: lifelines>=0.29; extra == "full"
|
|
62
|
+
Requires-Dist: scikit-posthocs>=0.9; extra == "full"
|
|
63
|
+
Provides-Extra: dev
|
|
64
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
65
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
66
|
+
Requires-Dist: hypothesis>=6; extra == "dev"
|
|
67
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
68
|
+
Requires-Dist: mypy>=1.11; extra == "dev"
|
|
69
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
70
|
+
Requires-Dist: twine>=6.0; extra == "dev"
|
|
71
|
+
Dynamic: license-file
|
|
72
|
+
|
|
73
|
+
# Starlibpy
|
|
74
|
+
|
|
75
|
+
**Statistical Tools for Academic Research Library**
|
|
76
|
+
|
|
77
|
+
**Project author:** Dr. M.A. Melzi, MD
|
|
78
|
+
**Recommended import:** `import starlibpy as slp`
|
|
79
|
+
**Release:** `0.3.0b2` — publication-candidate beta
|
|
80
|
+
|
|
81
|
+
**Repository:** https://github.com/mamelzi/starlibpy
|
|
82
|
+
**Issues:** https://github.com/mamelzi/starlibpy/issues
|
|
83
|
+
|
|
84
|
+
Starlibpy is a modular Python library for study-design specification, data
|
|
85
|
+
profiling and quality control, statistical analysis, diagnostic checking,
|
|
86
|
+
scientific visualization, and publication-ready reporting. It is intended for
|
|
87
|
+
academic, clinical, epidemiological, and biomedical research.
|
|
88
|
+
|
|
89
|
+
## Design principles
|
|
90
|
+
|
|
91
|
+
1. **The design precedes the test.** `StudyDesign` represents the protocol;
|
|
92
|
+
`AnalysisDesign` represents one statistical question.
|
|
93
|
+
2. **Methods are explainable.** Assumptions, requested method, selected method,
|
|
94
|
+
fallback, population, exclusions, effect size, confidence interval, and
|
|
95
|
+
warnings remain attached to the result.
|
|
96
|
+
3. **Analyses return typed objects.** Statistical functions return a
|
|
97
|
+
`StarResult` subclass rather than printing or plotting implicitly.
|
|
98
|
+
4. **Calculation and presentation are separate.** `render_table()` and
|
|
99
|
+
`plot_result()` convert results to publication outputs without recalculating
|
|
100
|
+
statistics.
|
|
101
|
+
5. **Optional functionality stays optional.** Missing plotting, export,
|
|
102
|
+
survival, or post-hoc dependencies never block the core package import.
|
|
103
|
+
6. **Extensions are first-class.** Third-party modules can register analyses,
|
|
104
|
+
result types, table renderers, and plot renderers.
|
|
105
|
+
|
|
106
|
+
## Installation
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install starlibpy
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Common optional groups:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pip install "starlibpy[data]"
|
|
116
|
+
pip install "starlibpy[plotting]"
|
|
117
|
+
pip install "starlibpy[diagnostic]"
|
|
118
|
+
pip install "starlibpy[reporting]"
|
|
119
|
+
pip install "starlibpy[survival]"
|
|
120
|
+
pip install "starlibpy[full]"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Install this source distribution locally:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python -m pip install .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Quick start
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
import pandas as pd
|
|
133
|
+
import starlibpy as slp
|
|
134
|
+
|
|
135
|
+
cohort = pd.DataFrame(
|
|
136
|
+
{
|
|
137
|
+
"patient_id": [1, 2, 3, 4, 5, 6],
|
|
138
|
+
"group": ["control"] * 3 + ["intervention"] * 3,
|
|
139
|
+
"age": [51, 63, 58, 49, 54, 61],
|
|
140
|
+
"response": [0, 0, 1, 1, 1, 1],
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
profile = slp.profile_dataset(cohort)
|
|
145
|
+
|
|
146
|
+
description = slp.describe_continuous(
|
|
147
|
+
cohort,
|
|
148
|
+
columns=["age"],
|
|
149
|
+
random_state=2026,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
comparison = slp.compare_continuous(
|
|
153
|
+
data=cohort,
|
|
154
|
+
outcome="age",
|
|
155
|
+
group="group",
|
|
156
|
+
method="auto",
|
|
157
|
+
random_state=2026,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
publication_table = slp.render_table(comparison, template="journal")
|
|
161
|
+
figure = slp.plot_result(comparison, kind="group_comparison")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The raw analysis table remains available:
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
comparison.get_table()
|
|
168
|
+
comparison.list_outputs()
|
|
169
|
+
comparison.metadata
|
|
170
|
+
comparison.warnings
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Modules
|
|
174
|
+
|
|
175
|
+
| Module | Purpose |
|
|
176
|
+
|---|---|
|
|
177
|
+
| `starlibpy.design` | Protocol, variables, endpoints, analysis structure, provenance |
|
|
178
|
+
| `starlibpy.data` | Profiling, validation, missingness, audit, preparation, imputation |
|
|
179
|
+
| `starlibpy.descriptive` | Continuous, categorical, binary, count, date summaries and Table 1 |
|
|
180
|
+
| `starlibpy.estimation` | Confidence intervals and elementary estimands |
|
|
181
|
+
| `starlibpy.assumptions` | Assumption checks and explainable method recommendation |
|
|
182
|
+
| `starlibpy.comparisons` | One-sample, independent, paired, categorical, rate, and post-hoc tests |
|
|
183
|
+
| `starlibpy.association` | Pearson, Spearman, Kendall, partial and categorical association |
|
|
184
|
+
| `starlibpy.anova` | ANOVA, ANCOVA, repeated-measures, mixed, non-parametric, contrasts |
|
|
185
|
+
| `starlibpy.longitudinal` | Linear mixed models, GEE, covariance comparison, trajectories |
|
|
186
|
+
| `starlibpy.regression` | Linear, robust, logistic, count, ordinal, multinomial models |
|
|
187
|
+
| `starlibpy.diagnostic` | Diagnostic accuracy, ROC, PR, threshold, calibration, validation |
|
|
188
|
+
| `starlibpy.survival` | Time-to-event preparation, KM, log-rank, Cox, RMST, extensions |
|
|
189
|
+
| `starlibpy.agreement` | Kappa, ICC, Bland–Altman, concordance, repeatability |
|
|
190
|
+
| `starlibpy.effect_sizes` | Standardized and design-specific effect sizes |
|
|
191
|
+
| `starlibpy.multiplicity` | Family definition and p-value adjustment |
|
|
192
|
+
| `starlibpy.resampling` | Bootstrap, permutation, exact, cluster and stratified resampling |
|
|
193
|
+
| `starlibpy.equivalence` | Equivalence and non-inferiority analyses |
|
|
194
|
+
| `starlibpy.clinical` | Adverse events and experimental target-lesion RECIST 1.1 |
|
|
195
|
+
| `starlibpy.colors` | Accessible palettes, contrast, conversion, generation, themes |
|
|
196
|
+
| `starlibpy.reporting` | Publication tables, plots, captions, reports, exports |
|
|
197
|
+
| `starlibpy.plugins` | Complementary analysis and result-type registry |
|
|
198
|
+
|
|
199
|
+
## Documentation map
|
|
200
|
+
|
|
201
|
+
- `docs/ARCHITECTURE.md` — processing layers and result contracts;
|
|
202
|
+
- `docs/API_OVERVIEW.md` — common user entry points;
|
|
203
|
+
- `docs/API_INVENTORY.md` — generated inventory of the full public API;
|
|
204
|
+
- `docs/DEPENDENCIES.md` — backend, attribution, and citation policy;
|
|
205
|
+
- `docs/EXTENSIONS.md` — complementary-module and plugin contract;
|
|
206
|
+
- `docs/IMPLEMENTATION_STATUS.md` — stable, experimental, and extension areas;
|
|
207
|
+
- `docs/MIGRATION.md` — replacement of the former flat package;
|
|
208
|
+
- `TEST_REPORT.md` — automated validation and coverage summary.
|
|
209
|
+
|
|
210
|
+
## Method-selection modes
|
|
211
|
+
|
|
212
|
+
Analysis functions support an explicit method or an automatic workflow. The
|
|
213
|
+
canonical modes are:
|
|
214
|
+
|
|
215
|
+
- `auto`: select and document a compatible method;
|
|
216
|
+
- `parametric`: request a parametric method;
|
|
217
|
+
- `nonparametric`: request a rank/exact alternative;
|
|
218
|
+
- `robust`: request Welch, robust covariance, bootstrap, or another robust method;
|
|
219
|
+
- `exact`: request an exact method where available.
|
|
220
|
+
|
|
221
|
+
A method is not selected solely from a normality-test p-value. The analysis
|
|
222
|
+
structure, estimand, independence, group count, sample size, variance behavior,
|
|
223
|
+
residuals, influential observations, and method-specific assumptions are taken
|
|
224
|
+
into account where implemented.
|
|
225
|
+
|
|
226
|
+
## Tables, figures, and colors
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
table = result.table(template="journal", theme="journal_bw")
|
|
230
|
+
figure = result.plot(kind=result.default_plot, theme="default")
|
|
231
|
+
|
|
232
|
+
slp.list_table_templates()
|
|
233
|
+
slp.list_plot_templates()
|
|
234
|
+
slp.list_themes()
|
|
235
|
+
slp.list_palettes()
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Custom palette:
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
slp.register_palette(
|
|
242
|
+
"institution",
|
|
243
|
+
["#12355B", "#E4572E", "#17B890"],
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
slp.validate_palette_contrast(
|
|
247
|
+
slp.get_palette("institution"),
|
|
248
|
+
background="#FFFFFF",
|
|
249
|
+
)
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Complementary modules and plugins
|
|
253
|
+
|
|
254
|
+
An installed package may expose an entry point in the group
|
|
255
|
+
`starlibpy.plugins`. Its registration callable can add analyses and result
|
|
256
|
+
classes:
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
from starlibpy.plugins import register_analysis
|
|
260
|
+
|
|
261
|
+
def register():
|
|
262
|
+
register_analysis("my_special_analysis", my_special_analysis)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
A plugin can also use `register_table_renderer()` and
|
|
266
|
+
`register_plot_renderer()` to make its results publication-ready.
|
|
267
|
+
|
|
268
|
+
## Clinical and scientific limitations
|
|
269
|
+
|
|
270
|
+
- Starlibpy assists analysis; it does not replace a statistical analysis plan,
|
|
271
|
+
domain review, or clinical adjudication.
|
|
272
|
+
- Automatic recommendations remain recommendations and are stored with their
|
|
273
|
+
rationale and limitations.
|
|
274
|
+
- The RECIST component in this beta is explicitly restricted to target-lesion
|
|
275
|
+
SLD rules. Full RECIST 1.1 assessment also requires non-target lesion, nodal,
|
|
276
|
+
new-lesion, confirmation, and clinical rules not completely represented by
|
|
277
|
+
SLD alone.
|
|
278
|
+
- Fine–Gray regression and Gray's test require a registered competing-risks
|
|
279
|
+
plugin in this beta. Starlibpy does not silently substitute a different test.
|
|
280
|
+
|
|
281
|
+
## Scientific and clinical disclaimer
|
|
282
|
+
|
|
283
|
+
Starlibpy supports academic, methodological, epidemiological, biomedical, and clinical research workflows. Its outputs must be interpreted in light of the study design, data quality, statistical assumptions, uncertainty, and applicable scientific or regulatory guidance. The library does not replace independent statistical review, clinical judgment, regulatory validation, or protocol-specific adjudication.
|
|
284
|
+
|
|
285
|
+
## Migration from the former flat package
|
|
286
|
+
|
|
287
|
+
Selected old names remain in `starlibpy.legacy` with a `DeprecationWarning`.
|
|
288
|
+
The new API uses stable snake-case names and typed result objects. See
|
|
289
|
+
`docs/MIGRATION.md`.
|
|
290
|
+
|
|
291
|
+
## Citation
|
|
292
|
+
|
|
293
|
+
Use the release metadata in `CITATION.cff`:
|
|
294
|
+
|
|
295
|
+
> Melzi, M.A. *Starlibpy: Statistical Tools for Academic Research Library*.
|
|
296
|
+
> Version 0.3.0b2.
|
|
297
|
+
|
|
298
|
+
Also cite the scientific libraries and original methods directly used by your
|
|
299
|
+
analysis. A reusable bibliography is supplied in `REFERENCES.bib`.
|
|
300
|
+
|
|
301
|
+
## License
|
|
302
|
+
|
|
303
|
+
MIT License. See `LICENSE` and `THIRD_PARTY_LICENSES.md`.
|