This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method to categorize a particular | |
def categorize(particular): | |
# tokenizing | |
word_list = tokenize(particular) | |
# multiple similar statements | |
if keyword in word_list: | |
return category | |
# iterate over all transactions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BANK_DETAILS = { | |
'HDFC': { | |
'particulars': 1, # index of particulars column | |
'withdrawal': 4, # index of withdrawal column | |
'deposit': 5, # index of deposit column | |
'balance': 6, # index of balance column | |
'date': 0, # index of date column | |
'chq': 2, # index of cheque no. column | |
'value_date': 3 # index of value date column | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----- get header row ----- # | |
# list to contain all headers | |
headers = [] | |
# iterate over all rows | |
for row in rows: | |
if last column empty: | |
headers.append(rows) | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initializing variables | |
transactions = [] # list to store single row entries | |
d_i = index of date column # from BANK_DETAILS | |
p_i = index of particular column # from BANK_DETAILS | |
# iterate over all transactions | |
for v_t in valid_transactions: | |
# date exists in the row | |
if v_t[d_i] is not None: | |
transactions.append(v_t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reading table using tabula | |
rows = tabula.read_pdf(filepath, | |
pages='all', | |
silent=True, | |
pandas_options={ | |
'header': None, | |
'error_bad_lines': False, | |
'warn_bad_lines': False | |
}) | |
# converting to list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initializing variables | |
w_i = index of withdrawal column # from BANK_DETAILS | |
d_i = index of deposit column # from BANK_DETAILS | |
b_i = index of balance column # from BANK_DETAILS | |
is_negative = False # flag for default checking | |
final_result = [] # transactions with label assigned | |
# iterate over all transactions | |
for transaction in transactions: | |
# debit leading to a negative balance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xe | |
# install packages and dependencies | |
go get github.com/dgrijalva/jwt-go | |
# build command | |
go build -o bin/application application.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bin/application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make: ./build.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xe | |
# build binary | |
GOARCH=amd64 GOOS=linux go build -o bin/application application.go | |
# create zip containing the bin, assets and .ebextensions folder | |
zip -r uploadThis.zip bin public .ebextensions |
OlderNewer