Spaces:
Sleeping
Sleeping
Update imports_utils.py
Browse files- imports_utils.py +4 -36
imports_utils.py
CHANGED
@@ -33,9 +33,11 @@ notion = Client(auth=notion_token)
|
|
33 |
# ----------------------------------------------------------------------------------
|
34 |
|
35 |
|
36 |
-
|
37 |
|
38 |
speckleToken = os.getenv('speckleToken')
|
|
|
|
|
39 |
if speckleToken is None:
|
40 |
raise Exception("Speckle token not found")
|
41 |
else:
|
@@ -47,7 +49,7 @@ else:
|
|
47 |
CLIENT = SpeckleClient(host="https://speckle.xyz/")
|
48 |
account = get_default_account()
|
49 |
CLIENT.authenticate(token=speckleToken)
|
50 |
-
|
51 |
|
52 |
# query full database
|
53 |
def fetch_all_database_pages(client, database_id):
|
@@ -140,40 +142,6 @@ def get_page_by_id(notion_db_pages, page_id):
|
|
140 |
return pg
|
141 |
|
142 |
|
143 |
-
"""
|
144 |
-
|
145 |
-
landuseMapperDict ={}
|
146 |
-
subdomains_unique = []
|
147 |
-
|
148 |
-
for page in landuse_attributes:
|
149 |
-
value_landuse = get_property_value(page, landuseColumnName)
|
150 |
-
value_subdomain = get_property_value(page, subdomainColumnName)
|
151 |
-
if value_subdomain and value_landuse:
|
152 |
-
landuseMapperDict[value_landuse] = value_subdomain
|
153 |
-
if value_subdomain != "":
|
154 |
-
subdomains_unique.append(value_subdomain)
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
attributeMapperDict ={}
|
159 |
-
domains_unique = []
|
160 |
-
|
161 |
-
for page in livability_attributes:
|
162 |
-
subdomain = get_property_value(page, subdomainColumnName)
|
163 |
-
sqm_per_employee = get_property_value(page, sqmPerEmployeeColumnName)
|
164 |
-
thresholds = get_property_value(page, thresholdsColumnName)
|
165 |
-
max_points = get_property_value(page, maxPointsColumnName)
|
166 |
-
domain = get_property_value(page, domainColumnName)
|
167 |
-
if thresholds:
|
168 |
-
attributeMapperDict[subdomain] = {
|
169 |
-
'sqmPerEmpl': sqm_per_employee if sqm_per_employee != "" else 0,
|
170 |
-
'thresholds': thresholds,
|
171 |
-
'max_points': max_points,
|
172 |
-
'domain': [domain if domain != "" else 0]
|
173 |
-
}
|
174 |
-
if domain != "":
|
175 |
-
domains_unique.append(domain)
|
176 |
-
"""
|
177 |
from config import landuseColumnName
|
178 |
from config import subdomainColumnName
|
179 |
from config import sqmPerEmployeeColumnName
|
|
|
33 |
# ----------------------------------------------------------------------------------
|
34 |
|
35 |
|
36 |
+
notionToken = os.getenv('notionToken')
|
37 |
|
38 |
speckleToken = os.getenv('speckleToken')
|
39 |
+
|
40 |
+
"""
|
41 |
if speckleToken is None:
|
42 |
raise Exception("Speckle token not found")
|
43 |
else:
|
|
|
49 |
CLIENT = SpeckleClient(host="https://speckle.xyz/")
|
50 |
account = get_default_account()
|
51 |
CLIENT.authenticate(token=speckleToken)
|
52 |
+
"""
|
53 |
|
54 |
# query full database
|
55 |
def fetch_all_database_pages(client, database_id):
|
|
|
142 |
return pg
|
143 |
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
from config import landuseColumnName
|
146 |
from config import subdomainColumnName
|
147 |
from config import sqmPerEmployeeColumnName
|