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.1.tar.gz (19.0 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.1-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: liblaf_cherries-2.0.1.tar.gz
  • Upload date:
  • Size: 19.0 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.1.tar.gz
Algorithm Hash digest
SHA256 30f49b624cf4869058a69e28a2ce62271c249522f34b2bd7338dfd00bba8bac8
MD5 9cec9f539a8ef9d4c0057444d0843d5e
BLAKE2b-256 1d20ca386629089ed5b2e6d255fd7cfd18da68e07bc5dfc73ffd72c118f910e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_cherries-2.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: liblaf_cherries-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1e1635ae7bab5c138eb9f7a17c443e994b7b1c9d4164b24fed10e1fe7efb7da
MD5 4b2491685b26adf21f396dac1ca76bbc
BLAKE2b-256 1279100d2b131c32da0be4b66509dfab3ded996579e12b9af8ff37c43510ae90

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_cherries-2.0.1-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