Skip to main content

Simple and easy CSV logging

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.0.tar.gz (1.8 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.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easy_csv_logging-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 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.0.tar.gz
Algorithm Hash digest
SHA256 1efcee29208892b74577ab7e5b50ea689badd64a8625bf0905d20e503042dffe
MD5 423bd3a45ef6426399ea6974b1d721ac
BLAKE2b-256 aab723637f77e7e91ea7bd2abb8fa884a31f0e5a91f24bd1ff94140d6abb84a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for easy_csv_logging-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4244eee8a517148bfeee5ea01c53dd03262f21e66f9beea4993ee5e20655c9d
MD5 8120f8fd7dfaf833268e2ef1fa959475
BLAKE2b-256 954527e8c38040e95c0865e5658deac02e050f7ebac3ce5b52f999ec3ec5e6e8

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