forked from divya-rathi/CAMs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase_code.py
44 lines (40 loc) · 1.38 KB
/
firebase_code.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
import pyrebase
config = {
"apiKey" : "AIzaSyAIsSHOuNkfoGuUrJ5xQM2t6jNVT5TlHx8",
"authDomain" : "cams-da440.firebaseapp.com",
"databaseURL" : "https://cams-da440.firebaseio.com",
"projectId" : "cams-da440",
"storageBucket" : "cams-da440.appspot.com",
"messagingSenderId" : "592415369968"
}
firebase = pyrebase.initialize_app(config)
db = firebase.database()
global active,credentials
#Firebase
from firebase import firebase
firebase = firebase.FirebaseApplication('https://cams-da440.firebaseio.com/', None)
db = firebase.get('/', None)
print(db)
#db.child("credentials").child("CAMS0000").push({"EmailId":"[email protected]" , "Password": "admin@123"})
# userId = "CAMS"
# for i in range(2,5):
# if i <= 9:
# k = "000" +str(i)
# elif i >= 10 and i <= 99:
# k = "00" +str(i)
# elif i >=100 and i <= 999:
# k = "0" + str(i)
# uname = input()
# pwd = input()
# db.child("credentials").child(userId + k).set({"EmailId":uname , "Password": pwd})
#db.child("seats").push(({"branch":"elec sci","no_of_seats":"45"}))
ch = 'N'
while ch == 'Y':
branch = input()
c1 = int(input())
c2 = int(input())
c3 = int(input())
db.child("Cutoff").child(branch).set({"Current": c1, "Previous": c2, "TwoYearsPrev": c3})
ch = input()
# db.child("Cutoff").child("branch").remove()
#db.child("Cutoff").child("branch").update({'b': 1})