Skip to content

Commit 04f1672

Browse files
author
Hong-Thai Nguyen
committed
Read me and minor refactory
1 parent 70aaee5 commit 04f1672

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ or make transfer orders. The specifications of the format can be found on the `C
1717

1818
The first two usecase are : read bank statements, and make transfer orders
1919

20+
Installation
21+
----------------
22+
>>> pip install python-cfonb
23+
24+
2025
Statement Parser
2126
----------------
2227

cfonb/parser/common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# python import
2-
from datetime import datetime
31
import decimal
42
import math
53
import re
4+
from datetime import datetime
65

76
# blank only rule
87
G__ = r'( {%d})'

cfonb/parser/statement.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# cfonb import
21
from .common import Row, ParsingError
32

43

54
class 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

0 commit comments

Comments
 (0)