Skip to main content

Simple CSV logging and viewing

Project description

how it works is that it is two functions oneto write to log and another to view log in terminal

log(*args) This functions takes in values. Then these values get stored in csv_log.csv and in a more readable way in csv_log.txt

It has two more special cases. One where there is 0 arguments then it adds an row where each colum has no values One where there is 1 arguments then it fills in value under column 0 with the name "_____".

Else arguments will be interprited as pairs of column_name,value. Where name is always first The row will be filled based on these pairs.

#All of these are valid:

log("a",1,"b",3) log("2") log() log() log() log("patrik",999) log("patrik",999) log("patrik",999) log("patrik","999öööööööö") log("29999") log("29999") log("29999") log() log() log() log((2,2),(3,3),(4,4)) log(["2",2],["3",3],["4",4]) log([("2",2),("3",3),("4",4)])

This code will write this to csv_log.txt in the directory of the script where the module is called from. | _____: | a: 1.0 | b: 3.0 | patrik: | 2: | 3: | 4: | | _____: 2.0 | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: 999.0 | 2: | 3: | 4: | | _____: | a: | b: | patrik: 999.0 | 2: | 3: | 4: | | _____: | a: | b: | patrik: 999.0 | 2: | 3: | 4: | | _____: | a: | b: | patrik: 999öööööööö | 2: | 3: | 4: | | _____: 29999.0 | a: | b: | patrik: | 2: | 3: | 4: | | _____: 29999.0 | a: | b: | patrik: | 2: | 3: | 4: | | _____: 29999.0 | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: | 3: | 4: | | _____: | a: | b: | patrik: | 2: 2.0 | 3: 3.0 | 4: 4.0 | | _____: | a: | b: | patrik: | 2: 2.0 | 3: 3.0 | 4: 4.0 | | _____: | a: | b: | patrik: | 2: 2.0 | 3: 3.0 | 4: 4.0 |

csv_log.txt:

_____,a,b,patrik,2,3,4 ,1.0,3.0,,,, 2.0,,,,,, ,,,,,, ,,,,,, ,,,,,, ,,,999.0,,, ,,,999.0,,, ,,,999.0,,, ,,,999öööööööö,,, 29999.0,,,,,, 29999.0,,,,,, 29999.0,,,,,, ,,,,,, ,,,,,, ,,,,,, ,,,,2.0,3.0,4.0 ,,,,2.0,3.0,4.0 ,,,,2,3,4

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

easy_csv_logging-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

easy_csv_logging-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file easy_csv_logging-0.1.1.tar.gz.

File metadata

  • Download URL: easy_csv_logging-0.1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for easy_csv_logging-0.1.1.tar.gz
Algorithm Hash digest
SHA256 170687fd4ff27e1befa899234ceed8c10edbfe718c62df9da84bfcffd61c74b9
MD5 6dea1cdc5625bdb4a6c4d67def51cc7b
BLAKE2b-256 41dbe44d400529297b1b209b62c755257a37012a432fb006a3fd47fe5ee4457a

See more details on using hashes here.

File details

Details for the file easy_csv_logging-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_csv_logging-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b418af2bca71f7fd879ea7936e8b1f59ec2169bbae57983e33a4cdf5dff9131
MD5 31f371d8dc90f45e4467d6b60a43e883
BLAKE2b-256 6d6630a0ce00c032093ca571e0efa4d68a5818c5eb70ded3599f252083a512f6

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