Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
3b30238
1
Parent(s):
e688670
Update app.py
Browse files
app.py
CHANGED
@@ -6,18 +6,20 @@ from io import StringIO
|
|
6 |
from collections import OrderedDict
|
7 |
|
8 |
|
9 |
-
|
10 |
import os
|
11 |
|
12 |
-
# Accessing
|
13 |
-
|
|
|
|
|
14 |
|
|
|
15 |
if notionToken is None:
|
16 |
raise Exception("Secret token not found. Please check the environment variables.")
|
17 |
else:
|
18 |
print("Secret token found successfully!")
|
19 |
|
20 |
-
|
21 |
from config import landuseDatabaseId , subdomainAttributesDatabaseId
|
22 |
from imports_utils import fetch_all_database_pages
|
23 |
from imports_utils import get_property_value
|
@@ -65,6 +67,33 @@ for page in livability_attributes:
|
|
65 |
|
66 |
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
|
|
|
6 |
from collections import OrderedDict
|
7 |
|
8 |
|
9 |
+
|
10 |
import os
|
11 |
|
12 |
+
# ---------------------- Accessing data from Notion ---------------------- #
|
13 |
+
|
14 |
+
|
15 |
+
from notion_client import Client as client_notion
|
16 |
|
17 |
+
notionToken = os.getenv('notionToken')
|
18 |
if notionToken is None:
|
19 |
raise Exception("Secret token not found. Please check the environment variables.")
|
20 |
else:
|
21 |
print("Secret token found successfully!")
|
22 |
|
|
|
23 |
from config import landuseDatabaseId , subdomainAttributesDatabaseId
|
24 |
from imports_utils import fetch_all_database_pages
|
25 |
from imports_utils import get_property_value
|
|
|
67 |
|
68 |
|
69 |
|
70 |
+
# ---------------------- Accessing data from Speckle ---------------------- #
|
71 |
+
|
72 |
+
|
73 |
+
"""
|
74 |
+
from specklepy.api.client import Client as SpeckleClient
|
75 |
+
from specklepy.api.credentials import get_default_account
|
76 |
+
|
77 |
+
# Example usage
|
78 |
+
|
79 |
+
client = Client(host="your_speckle_server_host")
|
80 |
+
account = get_default_account()
|
81 |
+
client.authenticate(token=account.token)
|
82 |
+
|
83 |
+
|
84 |
+
CLIENT = SpeckleClient(host="https://speckle.xyz/")
|
85 |
+
CLIENT.authenticate_with_token(token=userdata.get('speckleToken'))
|
86 |
+
"""
|
87 |
+
|
88 |
+
from config import landuseDatabaseId , streamId, branch_name_dm, commit_id
|
89 |
+
from imports_utils import streamMatrices
|
90 |
+
|
91 |
+
|
92 |
+
streamDistanceMatrices = streamMatrices (speckleToken, streamId, branch_name_dm, commit_id)
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
|
98 |
|
99 |
|