Metadata-Version: 2.4
Name: classification-report-as-df
Version: 0.1.1
Summary: sklearn-style classification report as a pandas DataFrame
Author-email: Michał Kałuski <kaluski.michal58@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Michał Kałuski
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/Michal58/classification-report-as-df
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: jinja2
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: beautifulsoup4; extra == "dev"
Dynamic: license-file

# classification-report-as-df
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Michal58/classification-report-as-df/blob/main/LICENSE)
[![Tests](https://github.com/Michal58/classification-report-as-df/actions/workflows/integration-tests.yml/badge.svg)](
https://github.com/Michal58/classification-report-as-df/actions/workflows/integration-tests.yml
)

Small, single-module utility that converts scikit-learn's text-style classification report into an easy-to-manipulate pandas `DataFrame`.
For easier display in IPython environments (e.g. Jupyter), the report can also be returned as a pandas `Styler`.

## Example usage
General scenario:
```python
import numpy as np
from classification_report_as_df import classification_report_as_df

y_true = np.array([0, 1, 0, 1, 1])
y_pred = np.array([0, 0, 0, 1, 1])

df = classification_report_as_df(
    y_true=y_true,
    y_pred=y_pred
)
```
Jupyter notebook pretty-rendering scenario:
```python
import numpy as np
from classification_report_as_df import classification_report_as_df

y_true = np.array([0, 1, 0, 1, 1])
y_pred = np.array([0, 0, 0, 1, 1])

classification_report_as_df(
    y_true=y_true,
    y_pred=y_pred,
    decimal_places_for_display=2
)
```

## Development
Clone repository:
```
git clone https://github.com/Michal58/classification-report-as-df
cd classification-report-as-df
```
Install dependencies:
```
pip install classification_report_as_df[dev]
```
or (from root directory):
```
pip install -e '.[dev]'
```

You can run tests calling (from root directory): 
```
pytest
```
## License

This project is licensed under the MIT License — see the `LICENSE` file for details.
