Skip to content

Instantly share code, notes, and snippets.

View samkit-jain's full-sized avatar
👨‍💻
Honing my craft

Samkit Jain samkit-jain

👨‍💻
Honing my craft
View GitHub Profile
#!/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
make: ./build.sh
web: bin/application
# 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
# 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
# ----- 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:
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
},