Skip to main content

Lightweight and lazy experiment logging

Project description

License PyPI PyPI - Python Version Documentation Status Coverage badge

LazyscribeLazyscribe

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
    ...

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

lazyscribe-2.2.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

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

lazyscribe-2.2.1-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file lazyscribe-2.2.1.tar.gz.

File metadata

  • Download URL: lazyscribe-2.2.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for lazyscribe-2.2.1.tar.gz
Algorithm Hash digest
SHA256 56819796eddf2410c0cabaf536ab26a2c8b577b1e0a641b4858b4b771756b313
MD5 b36efd1910450ae798a51b182c1f6ee4
BLAKE2b-256 5cd76948bb60b42ef51181335cd47eaa354fe226dfbcd273376cdad86a018798

See more details on using hashes here.

File details

Details for the file lazyscribe-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: lazyscribe-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for lazyscribe-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08c2d9357211bf5a26c325b75382a08f9408b30dd3399999376886ce1f173106
MD5 03a5adf3624dbe2dd88437a8d77f7f04
BLAKE2b-256 60291bf58da3ade5d24bf793b2284b3a4a8864767269c256507905a5746e330d

See more details on using hashes here.

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