X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/816b071c52f7f22ca39a7233d46a6a499061b6e6..17fbeca224cc68267056f9c12f6da86e16ba8cdd:/bin/monzo.py diff --git a/bin/monzo.py b/bin/monzo.py index 722cc5f..693c921 100755 --- a/bin/monzo.py +++ b/bin/monzo.py @@ -7,9 +7,11 @@ import sys outformat = "qif" # outformat = "csv" + class UnknownAccountError(Exception): pass + def get_account(data): account_id = data["transactions"][0]["account_id"] if account_id == "": @@ -19,6 +21,7 @@ def get_account(data): raise UnknownAccountError(account_id) + if __name__ == "__main__": with open(sys.argv[1], 'r') if len(sys.argv) > 1 else sys.stdin as fp: data = json.load(fp)