Skip to main content

Log and Flow tracking made easy with Python

Project description

lognflow

Log and Flow tracking made easy with Python. You can install it by::

pip install lognflow

A simple program to use it would be similar to the following::

from lognflow import lognflow
import numpy as np

data = np.random.rand(100)

logger = lognflow(r'c:\all_logs\\')
logger('This is a test for lognflow and log_single')
logger.log_single('data', data)

The logviewer is also very useful::

from lognflow import logviewer
logged = logviewer(r'c:\all_logs\some_log\\')
data = logged.get_single('data')

The printprogress makes a pretty nice progress bar::

from lognflow import printprogress
N = 100
pbar = printprogress(N)
for _ in range(N):
	# do_something()
	pbar()

In this package we use a folder on the HDD to generate files and folders in typical formats such as numpy npy and npz, png, ... to log. A log viewer is also availble to turn an already logged flow into variables. Obviously, it will read the folders and map them for you, which is something you could spend hours to do by yourself. Also there is the nicest progress bar, that you can easily understand and use or implement yourself when you have the time.

Looking at most logging packages online, you see that you need to spend a lot of time learning how to use them and realizing how they work. Especially when you have to deal with http servers and ... which will be a huge pain when working for companies who have their own HPC.

This is why lognflow is handy and straight forward.

Many tests are avialable in the tests directory.

Features

  • lognflow puts all the logs into a directory on your pc
  • lognflow makes it easy to log text or simple plots.
  • logviewer makes it easy to load variables or directories
  • printprogress is one of the best progress bars in Python.

Credits ^^^^^^^^

This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage

History

0.1.0 (2022-11-16)

  • First release on PyPI.

0.3.0 (2022-12-19)

  • Very consistent and easy-to-handle interface

0.3.2 (2022-12-27)

  • log your dictionary.

0.5.2 (2023-01-11)

  • logger call takes txt only for the main_log
  • main_log name can have no time_stamp
  • All logs can be force_flush = True.
  • del is well implemented.

0.5.3 (2023-03-19)

  • use logger.log_single('aName', aDict) to save a dictionary using numpy.savez
  • time_in_file_name has been changed to time_tag, sorry there! but early stages.
  • time_tag is True in the constructor, but could always be set to False
  • All tests passed!

0.6.0 (2023-03-22)

  • This is a stable release
  • All text files are handled by the with statement
  • Renaming bug is fixed
  • all tests run properly.
  • lognflow has all that logviewer has. We will check if dir exists at every use

0.6.1 (2023-03-22)

  • rename had a bug that is fixed

0.6.2 (2023-03-25)

  • made it possible to flush_all()
  • We support Python 3.7+ because of dataclasses
  • printprogress now can disable printing anything and return ETA at the call

0.6.3 (2023-04-01)

  • lognflow class does all logviewer does. Maybe it is time to remove logviewer.

0.6.4 (2023-04-06)

  • Better documentation and examples for readme
  • get_var is added to lognflow to get buffered variables logged by log_var

0.6.5 (2023-04-26)

  • Fixed a bug in the docs to allow sphinx compile it.
  • log_var will log only the valid time stamps.
  • added end keyword argument to log_text

0.6.6 (2023-04-27)

  • Better documentation
  • added tifffile imread to logviewer and imwrite to lognflow

0.6.7 (2023-04-27)

  • A bug in tifffile support was fixed

0.6.8 (2023-05-04)

  • Fixing readme for PyPI.
  • removed marker from log_plot. user marker and linestyle keyword arguments.
  • printprogress returns proper ETA every time if print_function is set to None::

0.7.0 (2023-05-15)

  • logviewer returns data by log_sigle if the full name is mentioned.

0.7.1 (2023-05-22)

  • printprogress supports lognflow.
  • bugs fixed in lognflow.
  • For now I guess lognflow and logviewer could be separate.

0.7.2 (2023-05-25)

  • bug fixed in logviewer
  • text_to_object added to logviewer to read dict or list logged via log_single
  • test pass for logviewer including the test for text_to_object

0.7.3 (2023-06-01)

  • bug fixed in logviewer in the use of suffix in get_stack_of_files
  • log_imshow takes colorbar and remove_axis_ticks flags.
  • every lognflow instance has a logviewer pointing to its log_dir called logged.

0.7.4 (2023-06-26)

  • critical bug fixed in log_imshow

0.7.5 (2023-06-27)

  • Added complex numbers to log_imshow

0.7.6 (2023-07-17)

  • printprogress can handle up to 99 days
  • log_text takes any save_as
  • If variable name has escape key is alright
  • If variable name is splitable, we replace them with _

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

lognflow-0.7.6.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

lognflow-0.7.6-py2.py3-none-any.whl (24.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lognflow-0.7.6.tar.gz.

File metadata

  • Download URL: lognflow-0.7.6.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for lognflow-0.7.6.tar.gz
Algorithm Hash digest
SHA256 abef44ff2cdc1f327fd94921454823f43ef8cb2c8935f788d3efbebfa2103292
MD5 98d38ba8433062d17e7455347c7b7553
BLAKE2b-256 c3a6687f87388c8a6ff39799a93b17cc4cb9345892b1c95f4695c5a55f844d7a

See more details on using hashes here.

File details

Details for the file lognflow-0.7.6-py2.py3-none-any.whl.

File metadata

  • Download URL: lognflow-0.7.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for lognflow-0.7.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 abccb85ba057a5094a646dab1c23ff709376fd3b29518a41cb3efa563025bf86
MD5 e614717a5d377977897f4d5f475863f4
BLAKE2b-256 e49a53776b26385b35460bb6a993b3328b04293ac783e6f9ecc592d827e392d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page