diff --git a/bnp_pdf_statement_parser.py b/bnp_pdf_statement_parser.py index a80c066..cf9bda3 100755 --- a/bnp_pdf_statement_parser.py +++ b/bnp_pdf_statement_parser.py @@ -46,7 +46,7 @@ for folder in os.listdir(): for line in lines: if not started: # We are interested in the content after this line: - if soldeCrediteurAuRegex.match(line) != None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage): + if soldeCrediteurAuRegex.match(line) is not None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage): if soldeCrediteurAuRegex.match(line): initialAmount = float(soldeCrediteurAuRegex.sub('', line).replace(',', '.').replace(' ', '')) currentAmount = initialAmount @@ -56,15 +56,15 @@ for folder in os.listdir(): continue else: # We aren't interested in the content after this line: - if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) != None: + if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) is not None: firstPage = False started = False continue # We aren't interested in the content after this line elif line.startswith('TOTAL DES OPERATIONS'): break - if firstLineOfPaymentRegex.match(line) != None: - if date != None: + if firstLineOfPaymentRegex.match(line) is not None: + if date is not None: print(date, valeur, amount, currentAmount) print('\n'.join(comment)) print()