Metadata-Version: 2.4
Name: ml
Version: 0.1.0
Summary: A collection of machine learning utilities
Project-URL: Homepage, https://github.com/EntilZha/ml
Project-URL: Repository, https://github.com/EntilZha/ml
Project-URL: Issues, https://github.com/EntilZha/ml/issues
Author-email: Pedro Rodriguez <me@pedro.ai>
Maintainer-email: Pedro Rodriguez <me@pedro.ai>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: machine learning,ml,utilities
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: cli
Requires-Dist: rich>=13.0; extra == 'cli'
Requires-Dist: typer>=0.12; extra == 'cli'
Description-Content-Type: text/markdown

# ml

A collection of machine learning utilities.

## Installation

```bash
pip install ml
```

A collection of utilities for ML/NLP research.

## Utilities

### `ml.snapshot`

Isolate experiment code on shared / networked filesystems (e.g. Slurm) by
copying the current directory into a per-experiment snapshot and running a
command inside the copy. Editing your source afterwards won't affect queued or
in-flight jobs.

As a library (standard library only):

```python
from ml.snapshot import snapshot

snapshot_dir = snapshot(
    "python train.py",
    exclude=["*.log", "wandb"],
    experiment_id="42",
)
```

As a CLI (requires the `cli` extra: `pip install 'ml[cli]'`):

```bash
ml-snapshot --experiment-id 42 --exclude '*.log' 'python train.py'
```

The base directory defaults to `$SNAPSHOT_DIR` (or `snapshotted_experiments`),
and exclude patterns fall back to the comma-separated `$SNAPSHOT_EXCLUDE`.

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management.

```bash
# Install dependencies (including dev tools)
uv sync

# Run the test suite
uv run pytest

# Lint and format
uv run ruff check .
uv run ruff format .
```

## License

[Apache License 2.0](LICENSE)
