Metadata-Version: 2.4
Name: drytorch
Version: 0.1.0b4
Summary: This package helps train, document and evaluate a Pytorch model.
Project-URL: Repository, https://github.com/nverchev/drytorch
Project-URL: Issues, https://github.com/nverchev/drytorch/issues
Project-URL: Changelog, https://github.com/nverchev/drytorch/blob/master/CHANGELOG.md
Author-email: Nicolas Vercheval <nicolas.vercheval@ugent.be>
License: MIT License
        
        Copyright (c) 2025 Nicolas Vercheval
        
        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.
License-File: LICENSE
Keywords: logger,pytorch
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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.11
Requires-Dist: numpy>=1.26.0
Requires-Dist: torch>=2.5.1
Provides-Extra: all-trackers
Requires-Dist: hydra-core>=1.3.0; extra == 'all-trackers'
Requires-Dist: matplotlib>=3.3.0; extra == 'all-trackers'
Requires-Dist: plotly>=4.10.0; extra == 'all-trackers'
Requires-Dist: pyyaml>=6.0; extra == 'all-trackers'
Requires-Dist: sqlalchemy>=2.0.12; extra == 'all-trackers'
Requires-Dist: tensorboard>=2.17.0; extra == 'all-trackers'
Requires-Dist: tqdm>=4.50.0; extra == 'all-trackers'
Requires-Dist: visdom>=0.1.6; extra == 'all-trackers'
Requires-Dist: wandb>=0.20.0; extra == 'all-trackers'
Provides-Extra: dev
Requires-Dist: hypothesis>=0.1.0; extra == 'dev'
Requires-Dist: jupytext>=1.18.1; extra == 'dev'
Requires-Dist: notebook; extra == 'dev'
Requires-Dist: pre-commit>=4.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=2.12.1; extra == 'dev'
Requires-Dist: pytest-mock>=3.4.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Provides-Extra: recommended-trackers
Requires-Dist: pyyaml>=6.0; extra == 'recommended-trackers'
Requires-Dist: tqdm>=4.50.0; extra == 'recommended-trackers'
Provides-Extra: support
Requires-Dist: optuna>=4.0.0; extra == 'support'
Requires-Dist: pandas==2.3.0; extra == 'support'
Requires-Dist: torcheval; extra == 'support'
Requires-Dist: torchmetrics>=1.0.0; extra == 'support'
Provides-Extra: type
Requires-Dist: basedpyright>=1.31.1; extra == 'type'
Requires-Dist: pandas-stubs; extra == 'type'
Requires-Dist: plotly-stubs; extra == 'type'
Requires-Dist: types-pyyaml; extra == 'type'
Requires-Dist: types-tqdm; extra == 'type'
Description-Content-Type: text/markdown

![drytorch_logo.png](resources/drytorch_logo.png)
[![PyPI version](https://img.shields.io/pypi/v/drytorch.svg?style=flat)](https://pypi.org/project/drytorch/)
[![Total Downloads](https://img.shields.io/pypi/dm/drytorch?label=downloads&style=flat)](https://pypi.org/project/drytorch/)
[![Python](https://img.shields.io/pypi/pyversions/drytorch.svg?style=flat)](https://pypi.org/project/drytorch/)
[![License](https://img.shields.io/github/license/nverchev/drytorch.svg)](LICENSE)
[![CI Status](https://github.com/nverchev/drytorch/actions/workflows/ci.yaml/badge.svg)](https://github.com/nverchev/drytorch/actions/workflows/CI.yaml)
[![codecov](https://codecov.io/github/nverchev/drytorch/graph/badge.svg?token=CZND67KAW1)](https://codecov.io/github/nverchev/drytorch)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![basedpyright - checked](https://img.shields.io/badge/basedpyright-checked-ffc000)](https://docs.basedpyright.com)
# DRYTorch
A lean, minimal framework for machine-learning experiments. It enforces best practices and maximizes code reusability via a modular, decoupled design.

## 🌟 Features at a Glance

* **DRY Training Cycle:** Minimal boilerplate for a wide range of ML applications. Includes a hook-based training cycle, adaptive data loading, and simplified checkpointing.
* **Protocol-Driven Modularity:** Components communicate via defined protocols and abstract classes, ensuring type safety and flexibility for custom classes.
* **Decoupled Tracking:** An event system notifies optional external libraries (Hydra, W&B, TensorBoard, etc.). Trackers do not impact the core experiment.
* **Enforced Best Practices:** All logic runs within an **experimental scope** to discourage dependencies, prevent data leakage, and ensure correct configuration.

## 🛠️ Installation

**Requirements**
The library only requires recent versions of **PyTorch** and **NumPy**. Tracker dependencies are optional.

**Installation**
Using pip:
```bash
pip install drytorch
```

Using uv
```bash
uv add drytorch
```

## 🏗️ Library Organization

The library uses a microkernel (plugin) architecture to separate concerns.

1.  **Core (`core`):** The library kernel. Contains the **Event System**, **Protocols** for component communication, and internal safety **Checks**.
2.  **Standard Library (`lib`):** Reusable implementations and abstract classes of the protocols.
3.  **Trackers (`tracker`):** Optional tracker plugins that integrate via the event system.
4.  **Contributions (`contrib`):** Dedicated space for community-driven extensions.
5. **Utilities (`utils`):**
Functions and classes independent to the framework.

## 🚀 Usage

Dive into the full, runnable examples:

<div style="display: flex; justify-content: space-between; align-items: center;">
    <p style="margin: 0;">
        ➡️ <strong><a href="https://github.com/nverchev/drytorch/blob/main/docs/tutorials/getting_started.ipynb">Getting Started Notebook</a></strong>
    </p>
    <a target="_blank" href="https://colab.research.google.com/github/nverchev/drytorch/blob/main/docs/tutorials/getting_started.ipynb">
        <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" style="vertical-align: middle;"/>
    </a>
</div>
