Skip to main content

CI License MIT Python3.8 pypi codecov

DiaryPy

A python class to automatically save the partial/intermediary results of a running experiment in a set of notebooks (csv files) and images as files.

Build Status

Create a new diary

from diarypy.diary import Diary
diary = Diary(name='world', path='hello', overwrite=False,
              stdout=False, stderr=False)

Create all the notebooks that you want to use

diary.add_notebook('validation')
# You can use the returned instance later
notebook_test = diary.add_notebook('test')
# And specify the header
notebook_train = diary.add_notebook('training', header=['iteration', 'accuracy'])

Store your results in the different notebooks

diary.add_entry('validation', ['accuracy', 0.3])
diary.add_entry('validation', ['accuracy', 0.5])
diary.add_entry('validation', ['accuracy', 0.9])
notebook_train.add_entry([0, 0.4])
notebook_train.add_entry([1, 0.6])
notebook_train.add_entry([2, 0.8])
notebook_test.add_entry(['First test went wrong', 0.345, 'label_1'])

Add an image

from PIL import Image
image = Image.new(mode="1", size=(16,16), color=0)
diary.save_image(image, filename='test_results')

Resulting files

The files that are generated after executing the previous lines are

hello/
└── world
    ├── description.txt
    ├── images
    │   └── test_results_4.png
    ├── test.csv
    └── training.csv
    └── validation.csv

the content of the files is

description.txt

Date: 2015-10-22 17:43:19.764797
Name : world
Path : hello/world
Overwrite : False
Image_format : png

validation.csv

1,1,|2021-06-17|,|12:56:45.945000|,|accuracy|,0.3
2,2,|2021-06-17|,|12:56:46.813717|,|accuracy|,0.5
3,3,|2021-06-17|,|12:56:53.358989|,|accuracy|,0.9

training.csv

|id1|,|id2|,|date|,|time|,|iteration|,|accuracy|
4,1,|2021-06-17|,|12:56:54.231691|,0,0.4
5,2,|2021-06-17|,|12:56:55.128130|,1,0.6
6,3,|2021-06-17|,|12:56:56.006014|,2,0.8

test.csv

7,1,|2021-06-17|,|12:56:56.761961|,|First test went wrong|,0.345,|label_1|

Unittest

python -m unittest discover diarypy

Metadata

Release files for diarypy 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diarypy 0.4.3
File Size Uploaded Provenance
diarypy-0.4.3.tar.gz 7.8 kB Without provenance Details

Release files / diarypy-0.4.3.tar.gz

Download URL diarypy-0.4.3.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
59d790143a238c53ac3d792458c529d6bf463b9e6715c3d3111f8406f215e1e4
BLAKE2b-256 checksum
How to use checksums
d54f19828d84a6653fe758db0babe47c851c5ac8b5941d870115a19284a40bce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5

Security for diarypy 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page