-
Notifications
You must be signed in to change notification settings - Fork 0
/
credLib.py
56 lines (51 loc) · 1.21 KB
/
credLib.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import json
def createBlankCred():
data = {
'email' :
{
'emailU' : '',
'emailP' : ''
}
,
'twitter' :
{
'key0' : '',
'key1' : ''
}
,
'phone' :
{
'phoneU' : '',
'phoneP' : ''
}
,
'shodan' :
{
'shodanK' : ''
},
'spotify' :
{
"SPOTIPY_CLIENT_ID" : "",
"SPOTIPY_CLIENT_SECRET" : "",
"SPOTIPY_REDIRECT_URI" : ""
},
'wyze' :
{
"email": "",
"password": ""
}
}
with open('credFile.json', 'w') as outfile:
json.dump(data, outfile)
def load_file():
with open('credFile.json') as json_file:
data = json.load(json_file)
return(data)
def fillbykey(key0, key1, param):
data = load_file()
data[key0][key1] = param
with open('credFile.json', 'w') as outfile:
json.dump(data, outfile)
def returnbykey(key0,key1):
data = load_file()
return(data[key0][key1])