https://github.com/liblaf/cherries
๐ Sweet experiment tracking with Comet, DVC, and Git integration.
https://github.com/liblaf/cherries
automation data-science experiment-tracking git logging machine-learning monitoring neptune pydantic python
Last synced: 11 days ago
JSON representation
๐ Sweet experiment tracking with Comet, DVC, and Git integration.
- Host: GitHub
- URL: https://github.com/liblaf/cherries
- Owner: liblaf
- License: mit
- Created: 2025-01-16T09:14:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-05-26T00:29:32.000Z (18 days ago)
- Last Synced: 2026-05-26T02:26:45.493Z (18 days ago)
- Topics: automation, data-science, experiment-tracking, git, logging, machine-learning, monitoring, neptune, pydantic, python
- Language: Python
- Homepage: https://cherries.readthedocs.io
- Size: 3.31 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

**[Explore the docs ยป](https://liblaf.github.io/cherries/)**
[](https://github.com/liblaf/cherries/actions/workflows/python-test.yaml)
[](https://codecov.io/gh/liblaf/cherries)
[](https://pypi.org/project/liblaf-cherries)
[](https://pypi.org/project/liblaf-cherries)
[](https://pypi.org/project/liblaf-cherries)
[](https://github.com/astral-sh/ruff)
[](https://github.com/astral-sh/uv)
[](https://results.pre-commit.ci/latest/github/liblaf/cherries/main)
[Changelog](https://github.com/liblaf/cherries/blob/main/CHANGELOG.md) ยท [Report Bug](https://github.com/liblaf/cherries/issues) ยท [Request Feature](https://github.com/liblaf/cherries/issues)

## โจ What Cherries Does
Cherries is a lightweight experiment runner for Python scripts that need just
enough structure to be repeatable. It builds typed config objects, resolves
stable data and temporary paths, stores scalar metrics as Polars dataframes, and
fans run events out to local files, Git, Comet, and custom plugins.
- **Typed configs**: pass `pydantic-settings` models into experiments and log
them as parameters automatically.
- **Reproducible paths**: resolve inputs, outputs, and temporary artifacts below
the entrypoint-derived run directory.
- **Metric history**: log one scalar or nested metric mappings such as
`{"train": {"loss": 0.4}}`, then read them back as tables.
- **Artifact bundles**: log VTK `.series` frames and optional mesh
`.landmarks.json` companions with their primary artifacts.
- **Plugin hooks**: compose ordered hooks for local snapshots, logging, Git,
Comet, or your own integrations.
- **Run profiles**: use `debug` for local work without remote or commit side
effects, and `default` for the full logging pipeline.
## ๐ฆ Installation
```bash
uv add liblaf-cherries
```
## ๐ Quick Start
```python
from pathlib import Path
from liblaf import cherries
class Config(cherries.BaseConfig):
name: str = "world"
output: Path = cherries.output("hello.txt", mkdir=True)
def experiment(cfg: Config) -> None:
message = f"Hello, {cfg.name}!"
cfg.output.write_text(f"{message}\n")
cherries.log_params({"name": cfg.name})
cherries.log_metric("message_length", len(message))
if __name__ == "__main__":
cherries.main(experiment, profile="debug")
```
`profile="debug"` keeps Comet disabled and Git commits off while still copying
the entrypoint, logs, and logged artifacts into `.cherries/runs/`. The default
profile enables Comet, commits dirty changes when needed, and records the final
Git SHA.
## ๐งญ Core Concepts
- `cherries.input()` logs existing inputs immediately.
- `cherries.output()` and `cherries.temp()` return paths immediately, then log
existing files when the run ends.
- `cherries.log_metric()` records one scalar; `cherries.log_metrics()` flattens
nested mappings with `/`.
- `CHERRIES_NAME` sets the human-readable run name; `CHERRIES_TAGS` attaches a
comma-separated tag list to summaries and Comet.
- Plugins subclass `liblaf.cherries.core.Plugin`, decorate hooks with
`liblaf.cherries.core.impl()`, and use `before` or `after` constraints for
deterministic order.
## โจ๏ธ Local Development
[](https://codespaces.new/liblaf/cherries)
```bash
gh repo clone liblaf/cherries
cd cherries
mise run install
uv run pytest
mise run lint
mise run docs:build
```
## ๐ Links
- [Documentation](https://liblaf.github.io/cherries/)
- [Source Code](https://github.com/liblaf/cherries)
- [Issue Tracker](https://github.com/liblaf/cherries/issues)
- [PyPI Package](https://pypi.org/project/liblaf-cherries/)
---
#### ๐ License
Copyright ยฉ 2026 [liblaf](https://github.com/liblaf).
This project is [MIT](https://github.com/liblaf/cherries/blob/main/LICENSE) licensed.