File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed
Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ or make transfer orders. The specifications of the format can be found on the `C
1717
1818The first two usecase are : read bank statements, and make transfer orders
1919
20+ Installation
21+ ----------------
22+ >>> pip install python- cfonb
23+
24+
2025Statement Parser
2126----------------
2227
Original file line number Diff line number Diff line change 1- # python import
2- from datetime import datetime
31import decimal
42import math
53import re
4+ from datetime import datetime
65
76# blank only rule
87G__ = r'( {%d})'
Original file line number Diff line number Diff line change 1- # cfonb import
21from .common import Row , ParsingError
32
43
54class StatementReader (object ):
6- """Statement file parser. Parse file object to corresponding
5+ """
6+ Statement file parser. Parse file object to corresponding
77 row objects for further use. Offers useful method for reading, writing and
88 comparing issues.
99 """
1010
1111 def parse (self , file_obj ):
12- """ Parser a file object and return the list of bank statement
13- extracted from the file"""
12+ """
13+ Parser a file object and return the list of bank statement
14+ extracted from the file
15+ """
1416
1517 file_lines = file_obj .readlines ()
1618 # content
1719 result = {}
1820 for index , line in enumerate (file_lines ):
19- #print(f"at line number {index+1}")
2021 if line [0 :2 ] == '01' :
2122 row = Row (line )
22-
2323 #If a statement already exist for the same account
2424 #we updated it else we create a new own
2525 if result .get (row .account_nb ):
@@ -53,12 +53,12 @@ def parse(self, file_obj):
5353
5454 return [result [key ] for key in result ]
5555
56- class Statement (object ):
5756
57+ class Statement (object ):
5858 def __init__ (self ):
5959 self .header = None
60- self .footer = None
61- self .lines = list ()
60+ self .footer = None
61+ self .lines = list ()
6262 self .account_nb = None
6363
6464
You can’t perform that action at this time.
0 commit comments