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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_csv_logging-0.1.3.tar.gz.
File metadata
- Download URL: easy_csv_logging-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4ccb1c358f46d40bb5ba73bb9daf59b4456cd3f82e412c34736c2af7174357a
|
|
| MD5 |
ef2891f6a5bcbe6f76133de941a4ffe9
|
|
| BLAKE2b-256 |
8245039c80e7c2bd4b3ecc2b845fa538edcc8e518f0e3b0358e0a80102dfd490
|
File details
Details for the file easy_csv_logging-0.1.3-py3-none-any.whl.
File metadata
- Download URL: easy_csv_logging-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed063fa92e79f6ff89adbf63b270436a1447e22d1dde39732cfcb93380e4a548
|
|
| MD5 |
0ca13dbb28d155063bc82dd98cae75ab
|
|
| BLAKE2b-256 |
654aabb009b720994eed6bd918228e18edaf29d85fd599bb5db7d3e371da5704
|