Skip to main content

A small Python experiment runner with typed settings, artifact path helpers, plugin hooks, and Comet/Git/local logging.

Project description

✨ Features

  • Typed experiment config: use Pydantic settings models as function arguments, with CLI parsing inherited from pydantic-settings.
  • Path helpers that log themselves: create asset, input, output, and temp paths once, then let Cherries flush existing files at run end.
  • Composable plugins: forward params, metrics, metadata, and artifacts through ordered hooks with before and after constraints.
  • Built-in run profiles: choose local debug snapshots or full Comet, Git, local, and logging integration for regular runs.
  • Artifact bundle expansion: log VTK .series frames and optional mesh landmark files alongside their primary artifact.

📦 Installation

uv add liblaf-cherries

🚀 Quick Start

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/. The default profile enables Comet, writes a Git summary, commits dirty changes, and logs the final Git SHA.

🧩 Plugin Model

Plugins subclass liblaf.cherries.core.Plugin, mark hook implementations with liblaf.cherries.core.impl(), and register on a Run or PluginManager. Hooks can return first results for getters, collect all non-None results for normal delegation, and keep running later plugins when one hook raises.

⌨️ Local Development

Open in GitHub Codespaces

gh repo clone liblaf/cherries
cd cherries
mise run install
uv run pytest
mise run lint
mise run docs:build

🔗 Links


📝 License

Copyright © 2025 liblaf.
This project is MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liblaf_cherries-2.0.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liblaf_cherries-2.0.2-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file liblaf_cherries-2.0.2.tar.gz.

File metadata

  • Download URL: liblaf_cherries-2.0.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for liblaf_cherries-2.0.2.tar.gz
Algorithm Hash digest
SHA256 3befbb97f3bd73257da35770a65092f3865888c8886a19034349386884b548e1
MD5 9fdf800173250c40aaa9566f023290e8
BLAKE2b-256 9c0ac2294b87e8cb2e6065b17d93b84fbff4143ff3ccc63784a2d9aa81da29ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_cherries-2.0.2.tar.gz:

Publisher: python-release.yaml on liblaf/cherries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file liblaf_cherries-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: liblaf_cherries-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for liblaf_cherries-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7942cf18676b333254eed29bc509b91b366dfa2c821cf99cd885f08381e17ca2
MD5 de3b60c660b30363d125fe296a875016
BLAKE2b-256 7dd5f8c8980e591d360c981b084fc114ca934269137d76f0a20e9313384978d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_cherries-2.0.2-py3-none-any.whl:

Publisher: python-release.yaml on liblaf/cherries

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page