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.2.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.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easy_csv_logging-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6375d4535f499fed57995b0727b5eb457cee91aaff3bd019f25273a28a40e8b9
MD5 0430791f1b0b200e95ee66bc3cb042a7
BLAKE2b-256 af741de48b7351951f96cad516f9c1721816a1bdcf740e22e85ed6ba665d9ad2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for easy_csv_logging-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d807081732202f2779e0d806f8dbd56f52f5eee84228211a5cc8347c150621a9
MD5 94907543063ed65ce08b3641484fed83
BLAKE2b-256 99ecfa36d51bfd4724674188e36c327f8bf6de297afceb1ebd81408b20740149

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