Skip to content

Instantly share code, notes, and snippets.

@litnimax
Created April 11, 2018 14:27
Show Gist options
  • Save litnimax/20059307b856f65776dcd1b11d5b649e to your computer and use it in GitHub Desktop.
Save litnimax/20059307b856f65776dcd1b11d5b649e to your computer and use it in GitHub Desktop.
TKS all operations parser
import xlrd
import sys
res = {}
rb = xlrd.open_workbook(sys.argv[1])
sheet = rb.sheet_by_index(0)
for rownum in range(sheet.nrows):
row = sheet.row(rownum)
d = row[0]
amount = row[4]
desc = row[11]
if amount.value > 2000:
#print d.value, amount.value, desc.value
if res.get(desc.value):
res[desc.value] += amount.value
else:
res[desc.value] = amount.value
for k,v in res.items():
print k, v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment