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, andtemppaths once, then let Cherries flush existing files at run end. - Composable plugins: forward params, metrics, metadata, and artifacts through ordered hooks with
beforeandafterconstraints. - Built-in run profiles: choose local debug snapshots or full Comet, Git, local, and logging integration for regular runs.
- Artifact bundle expansion: log VTK
.seriesframes 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
gh repo clone liblaf/cherries
cd cherries
mise run install
uv run pytest
mise run lint
mise run docs:build
🔗 Links
📝 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30f49b624cf4869058a69e28a2ce62271c249522f34b2bd7338dfd00bba8bac8
|
|
| MD5 |
9cec9f539a8ef9d4c0057444d0843d5e
|
|
| BLAKE2b-256 |
1d20ca386629089ed5b2e6d255fd7cfd18da68e07bc5dfc73ffd72c118f910e3
|
Provenance
The following attestation bundles were made for liblaf_cherries-2.0.1.tar.gz:
Publisher:
python-release.yaml on liblaf/cherries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liblaf_cherries-2.0.1.tar.gz -
Subject digest:
30f49b624cf4869058a69e28a2ce62271c249522f34b2bd7338dfd00bba8bac8 - Sigstore transparency entry: 1633488268
- Sigstore integration time:
-
Permalink:
liblaf/cherries@1e8eb1aa1f1859747d39b31a09440e7fcc75ff20 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/liblaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yaml@1e8eb1aa1f1859747d39b31a09440e7fcc75ff20 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1e1635ae7bab5c138eb9f7a17c443e994b7b1c9d4164b24fed10e1fe7efb7da
|
|
| MD5 |
4b2491685b26adf21f396dac1ca76bbc
|
|
| BLAKE2b-256 |
1279100d2b131c32da0be4b66509dfab3ded996579e12b9af8ff37c43510ae90
|
Provenance
The following attestation bundles were made for liblaf_cherries-2.0.1-py3-none-any.whl:
Publisher:
python-release.yaml on liblaf/cherries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liblaf_cherries-2.0.1-py3-none-any.whl -
Subject digest:
c1e1635ae7bab5c138eb9f7a17c443e994b7b1c9d4164b24fed10e1fe7efb7da - Sigstore transparency entry: 1633488286
- Sigstore integration time:
-
Permalink:
liblaf/cherries@1e8eb1aa1f1859747d39b31a09440e7fcc75ff20 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/liblaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yaml@1e8eb1aa1f1859747d39b31a09440e7fcc75ff20 -
Trigger Event:
release
-
Statement type: