X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4138643edec308936cedbbbdfbc4075fc5add8f7..80fa553cc77084a9e31f7c1ce3154afb817c1262:/bin/monzo.py diff --git a/bin/monzo.py b/bin/monzo.py index 9f404ef..e54aae5 100755 --- a/bin/monzo.py +++ b/bin/monzo.py @@ -17,6 +17,9 @@ if __name__ == "__main__": with open(sys.argv[1], 'r') if len(sys.argv) > 1 else sys.stdin as fp: data = json.load(fp) for t in data.get("transactions"): + if t.get("decline_reason", ""): + continue + try: date = datetime.strptime(t["created"], "%Y-%m-%dT%H:%M:%S.%fZ") except ValueError: