Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
salarysms
import json from urllib.request import urlopen import pandas as pd df = pd.read_excel('Bank name and sender address.xlsm', sheetname='Already updated in app') # can also index sheet by name or fetch all sheets mylist = df['sms_code'].tolist() with urlopen("https://phoneparloan.s3.ap-south-1.amazonaws.com/user_json_file/1562566069_2493498485d22ddb5315d0.json") as response: source =response.read() data = json.loads(source) still = False if not (data['sms_list']==[] or data['sms_list']['body']=[]) : still= True def match(str1,str2): modified=[str1.lower(),str1.upper(),str1[0].upper()+str1[1:]] for i in range(3): if modified[i] in str2: return True return False stillarray=[False]*len(data['sms_list']['body']) for i in range(len(data['sms_list']['body'])): stillarray[i]= still and((match('credited',data['sms_list']['body'][i])or match('debited',data['sms_list']['body'][i])) and (match('Rs',data['sms_list']['body'][i])or match('inr',data['sms_list']['body'][i]))and (match('sal',data['sms_list']['body'][i]))) for k in range(len(data['sms_list']['body'])): if data['sms_list']['address'][i] not in mylist: stillarray[i]=False for k in range(len(data['sms_list']['body'][i])): if data['sms_list']['body'][i][k:k+1]=='Rs'or data['sms_list']['body'][i][k:k+2]=='INR' or data['sms_list']['body'][i][k:k+1]=='RS': while data['sms_list']['body'][i][k]<'0' or data['sms_list']['body'][i][k]>'9': k=k+1 substr[i]=data['sms_list']['body'][i][k:k+11] for m in range(12): if data['sms_list']['body'][i][k+m]==',' continue if data['sms_list']['body'][i][k+m]<'0' or data['sms_list']['body'][i][k+m]>'9': substr[i]=data['sms_list']['body'][i][k:k+m-1] break salary=substr[i].replace(',','') if int(salary)<6000: stillarray[i]=False
run
|
edit
|
history
|
help
0
Rishika
First
Hai
PyRegSub
Принцип наименьшего времени Ферма
myone
Achinta
Lesson 7 part 2
Python virables
HW4