Metadata-Version: 2.4
Name: clean-data-schmidtaf
Version: 0.2.1
Summary: Functions to clean and prepare data for down-stream analyses.
Author-email: Amand Floriaan Schmidt <floriaanschmidt@gmail.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://gitlab.com/SchmidtAF/clean-data
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: pandas>=2.2
Requires-Dist: numpy>=2.1
Requires-Dist: scipy>=1.16.3
Requires-Dist: statsmodels>=0.14.4
Requires-Dist: lifelines>=0.30
Requires-Dist: scikit-learn>=1.5
Requires-Dist: openpyxl<4,>=3.1
Requires-Dist: matplotlib>=3.9
Provides-Extra: dev
Requires-Dist: pytest>=6; extra == "dev"
Requires-Dist: pytest-mock>=3; extra == "dev"
Requires-Dist: pytest-dependency>=0.5; extra == "dev"
Requires-Dist: codespell; extra == "dev"
Requires-Dist: bump2version>=1; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Requires-Dist: sphinx-bootstrap-theme; extra == "dev"
Requires-Dist: furo; extra == "dev"
Requires-Dist: myst-parser; extra == "dev"
Requires-Dist: nbsphinx; extra == "dev"
Requires-Dist: nbsphinx-link; extra == "dev"
Requires-Dist: sphinx-argparse; extra == "dev"
Requires-Dist: numpydoc; extra == "dev"
Requires-Dist: docutils<0.21; extra == "dev"
Requires-Dist: notebook; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: codespell; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Dynamic: license-file

# Data cleaning package
__version__: `0.2.1`

This repository collects python modules to clean and prepare data for downstream
analyses or presentation in reports. 
For example, the module contains functionality to created formatted publication
ready *baseline tables* or *supplementary excel tables*. 

Please consult the package 
[documentation](https://SchmidtAF.gitlab.io/clean-data/).

## Installation
At present, the repository is undergoing development and no packages exist yet
on PyPy or in Conda.
Therefore it is recommended that it is installed in either of the two ways
listed below.
First, clone this repository and then `cd` to the root of the repository.

```sh
git clone git@gitlab.com:SchmidtAF/clean-data.git
cd clean-data
```

### Installation using conda dependencies
A conda environment is provided in a `yaml` file in the directory
`./resources/conda/`.
A new conda environment called `clean-data` can be built using the command:

```sh
# From the root of the repository
conda env create --file ./resources/conda/envs/conda_create.yaml
```

To add to an existing environment use:

```sh
# From the root of the repository
conda env update --file ./resources/conda/envs/conda_update.yaml
```

Next the package can be installed:

```bash
make install
```

#### Development
For development work, install the package in editable mode with Git commit
hooks configured:

```bash
make install-dev
```
This command installs the package in editable mode and configures Git commit
hooks, allowing you to run `git pull` to update the repository or switch
branches without reinstalling.

Alternatively, you can install manually:
```bash
python -m pip install -e .
python .setup_git_hooks.py
```

#### Git Hooks Configuration


When setting up a development environment, the `setup-hooks` command
configures Git hooks to enforce conventional commit message formatting and
spell check using `codespell`.

To view the commit message format requirements, run:

```bash
./.githooks/commit-msg -help
```

For frequent use, add this function to your shell configuration (`~/.bashrc`
or `~/.zshrc`):

```bash
commit-format-help() {
    local git_root
    git_root=$(git rev-parse --show-toplevel 2>/dev/null)
    
    if [ -z "$git_root" ]; then
        echo "Error: Not inside a git repository"
        return 1
    fi
    
    local hook_path="$git_root/.githooks/commit-msg"
    
    if [ ! -f "$hook_path" ]; then
        echo "Error: commit-msg hook not found"
        return 1
    fi
    
    "$hook_path" --help
}
```

If you have already installed the package in editable mode without running
`_setup_git_hooks.py`, you can configure the hooks manually at any time by
running:

```bash
_setup_git_hooks.py
```

#### Validating the package

After installing the package from GitLab, you may wish to run the test
suite to confirm everything is working as expected:

```bash
# From the root of the repository
pytest tests
```

## Usage

Please have a look at the examples in
[resources](https://gitlab.com/SchmidtAF/clean-data/-/tree/master/resources/examples)
for some possible recipes.


