diff --git a/.gitignore b/.gitignore index 5ec68e7..82b859f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Ignore example output file +report.csv example/processed example/mappings/unmatched.csv # ---> Python diff --git a/report.py b/report.py new file mode 100644 index 0000000..0100a37 --- /dev/null +++ b/report.py @@ -0,0 +1,32 @@ +import subprocess +import numpy as np +import matplotlib.pyplot as plt +import pandas as pd + +def configure_plot(): + plt.figure() + axes = plt.gca() + axes.set_xlim([0, 300]) + axes.set_ylim([-256, 100]) + plt.xlabel("#bets []") + plt.ylabel("win [$]") + +def report(): + df = pd.read_csv("report.csv", + index_col='Account', + parse_dates=True) + df = df.drop(columns="Total:") + #print(df) + # print(df.info()) + df.plot.bar() + plt.savefig('figure_1.png') + # plt.show() + + +if __name__ == "__main__": + c = "hledger balance -M -V -b 2020 --depth 2 ^expenses: --transpose -o report.csv".split() + subprocess.call(c) + c = r"sed -i s/\$//g report.csv".split() + subprocess.call(c) + report() +