Metadata-Version: 2.3
Name: gen_surv
Version: 0.6.1
Summary: A Python package for simulating survival data, inspired by the R package genSurv
Home-page: https://github.com/DiogoRibeiro7/genSurvPy
License: MIT
Author: Diogo Ribeiro
Author-email: diogo_dj@hotmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: numpy (>=1.26,<2.0)
Requires-Dist: pandas (>=2.2.3,<3.0.0)
Requires-Dist: pytest-cov (>=6.1.1,<7.0.0)
Project-URL: Documentation, https://gen-surv.readthedocs.io/en/stable/
Project-URL: Repository, https://github.com/DiogoRibeiro7/genSurvPy
Description-Content-Type: text/markdown

# gen_surv

![Coverage](https://codecov.io/gh/DiogoRibeiro7/genSurvPy/branch/main/graph/badge.svg)
[![Docs](https://readthedocs.org/projects/gensurvpy/badge/?version=stable)](https://gensurvpy.readthedocs.io/en/stable/)

**gen_surv** is a Python package for simulating survival data under a variety of models, inspired by the R package [`genSurv`](https://cran.r-project.org/package=genSurv). It supports data generation for:

- Cox Proportional Hazards Models (CPHM)
- Continuous-Time Markov Models (CMM)
- Time-Dependent Covariate Models (TDCM)
- Time-Homogeneous Hidden Markov Models (THMM)

---

## 📦 Installation

```bash
poetry install
```
## ✨ Features

- Consistent interface across models  
- Censoring support (`uniform` or `exponential`)  
- Easy integration with `pandas` and `NumPy`  
- Suitable for benchmarking survival algorithms and teaching 

## 🧪 Example

```python
from gen_surv.cphm import gen_cphm

df = gen_cphm(
    n=100,
    model_cens="uniform",
    cens_par=1.0,
    beta=0.5,
    covar=2.0
)
print(df.head())
```

## 🔧 Available Generators

| Function     | Description                                |
|--------------|--------------------------------------------|
| `gen_cphm()` | Cox Proportional Hazards Model             |
| `gen_cmm()`  | Continuous-Time Multi-State Markov Model   |
| `gen_tdcm()` | Time-Dependent Covariate Model             |
| `gen_thmm()` | Time-Homogeneous Markov Model              |


```text
genSurvPy/
├── gen_surv/             # Pacote principal
│   ├── __main__.py       # Interface CLI via python -m
│   ├── cphm.py
│   ├── cmm.py
│   ├── tdcm.py
│   ├── thmm.py
│   ├── censoring.py
│   ├── bivariate.py
│   ├── validate.py
│
├── tests/                # Testes automatizados
│   ├── test_cphm.py
│   ├── test_cmm.py
│   ├── test_tdcm.py
│   ├── test_thmm.py
│
├── examples/             # Exemplos de uso
│   ├── run_cphm.py
│   ├── ...
│
├── pyproject.toml        # Configurado com Poetry
├── README.md
├── LICENSE
├── .gitignore
```

## 🧠 License

MIT License. See [LICENSE](LICENSE) for details.

