feat(code): Output data as csv to stdout on script run

When running data python script (`src/data.py`) directly through the command line,
we now use pandas to output the collected data directly as a csv to stdout.
Can then be redirected to e.g. a file to save the data in csv format.
This commit is contained in:
Marty Oehme 2023-12-14 18:06:39 +01:00
parent 73b96a757a
commit 38099c3358
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -39,6 +39,8 @@ if __name__ == "__main__":
else:
res = from_yml()
print(res)
# print out tsv file instead
# print(to_tsv(load_yaml.load(DEFAULT_YAML_PATH)))
from io import StringIO
output = StringIO()
res.to_csv(output)
output.seek(0)
print(output.read())