Lightweight, lazy experiment logging
lazyscribe is a lightweight package for model experiment logging. It creates a single JSON
file per project, and an experiment is only added to the file when code finishes (errors won't
result in partially finished experiments in your project log).
lazyscribe also has functionality to allow for multiple people to work on a single project.
You can merge projects together and update the list of experiments to create a single, authoritative
view of all executed experiments.
Installation
Python 3.10 and above is required. Use pip to install:
$ python -m pip install lazyscribe
Basic Usage
The basic usage involves instantiating a Project and using the context manager to log
an experiment:
import json
from lazyscribe import Project
project = Project(fpath="project.json")
with project.log(name="My experiment") as exp:
exp.log_metric("auroc", 0.5)
exp.log_parameter("algorithm", "lightgbm")
You've created an experiment! You can view the experimental data by using list:
print(json.dumps(list(project), indent=4))
[
{
"name": "My experiment",
"author": "<AUTHOR>",
"last_updated_by": "<AUTHOR>",
"metrics": {
"auroc": 0.5
},
"parameters": {
"algorithm": "lightgbm"
},
"created_at": "<CREATED_AT>",
"last_updated": "<LAST_UPDATED>",
"dependencies": [],
"short_slug": "my-experiment",
"slug": "my-experiment-<CREATED_AT>",
"tests": [],
"artifacts": []
}
]
Once you've finished, save the project to project.json:
project.save()
Later on, you can read the project back in read-only mode ("r"), append mode ("a"),
or editable mode ("w+"):
project = Project("project.json", mode="r")
with project.log(name="New experiment") as exp: # Raises a ReadOnlyError
...
Metadata
Release files for lazyscribe 2.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lazyscribe-2.2.2.tar.gz | 28.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lazyscribe-2.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.8 kB
Release files / lazyscribe-2.2.2.tar.gz
| Download URL | lazyscribe-2.2.2.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
481ec377f412dd0639e7efbd24538cdb904ffdeb5bbdc6a673b57202dfff06b3
|
|
BLAKE2b-256 checksum How to use checksums |
5572982f4faea58e8982ba4ec1638f7cafc6e082171009d57f885087321d62a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / lazyscribe-2.2.2-py3-none-any.whl
| Download URL | lazyscribe-2.2.2-py3-none-any.whl |
|---|---|
| Size | 37.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
138a07952ff23e53f2cd141f2d4fbf63f8731bf1a64b8841173d21e8875a7aec
|
|
BLAKE2b-256 checksum How to use checksums |
4c3041ae29804f686e2ea1ccaf52a17c60dbee5177cdb23ff93ea8b8d0390a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|