-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfileMerge.py
More file actions
44 lines (31 loc) · 1.07 KB
/
fileMerge.py
File metadata and controls
44 lines (31 loc) · 1.07 KB
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
import pandas as pd
import json
import os
from firebase import Firebase
folder = r'/Users/zenziali/Desktop/Phlask/JSWebScraping/treeOutput'
li = []
for f in os.listdir(folder) :
data = pd.read_csv(folder + '/' + f)
li.append(data)
final = pd.concat(li)
final = final[['Point X', 'Point Y', 'Street Address', 'City', 'Postal Code',
'Planting Site Id', 'Updated At', 'Tree Id', 'Genus', 'Species', 'Common Name'
]]
# final.to_csv('/Users/zenziali/Desktop/Phlask/treeMap.csv', index = False)
final.reset_index(drop=True, inplace=True)
data1 = json.loads(final.to_json(orient="records"))
# final[final['Tree Present'] != True]
config = {
'apiKey': "AIzaSyABw5Fg78SgvedyHr8tl-tPjcn5iFotB6I",
'authDomain': "phlask-web-map.firebaseapp.com",
'databaseURL': "https://phlask-web-map-forage.firebaseio.com",
'projectId': "phlask-web-map",
'storageBucket': "phlask-web-map.appspot.com"
}
firebase = Firebase(config)
auth = firebase.auth()
db = firebase.database()
data = db.get().val()
def save_data(data):
db.child('').set(data)
save_data(data1)