nastasiasnk commited on
Commit
c5b678e
1 Parent(s): f68e982

Update imports_utils.py

Browse files
Files changed (1) hide show
  1. imports_utils.py +8 -36
imports_utils.py CHANGED
@@ -1,6 +1,5 @@
1
  import sys
2
 
3
- #import other libaries
4
  from specklepy.api.client import SpeckleClient
5
  from specklepy.api.credentials import get_default_account, get_local_accounts
6
  from specklepy.transports.server import ServerTransport
@@ -8,48 +7,31 @@ from specklepy.api import operations
8
  from specklepy.objects.geometry import Polyline, Point
9
  from specklepy.objects import Base
10
 
11
-
12
  import numpy as np
13
  import pandas as pd
14
  import matplotlib.pyplot as plt
15
- #import seaborn as sns
16
  import math
17
  import matplotlib
18
- #from google.colab import files
19
-
20
  import json
21
 
22
  from notion_client import Client
23
  import os
24
 
25
- # Fetch the token securely from environment variables
26
- notion_token = os.getenv('notionToken')
27
-
28
- # Initialize the Notion client with your token
29
  notion = Client(auth=notion_token)
 
30
 
 
 
 
 
 
 
31
 
32
 
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:
44
- print("Speckle token found successfully!")
45
-
46
- #CLIENT = SpeckleClient(host="https://speckle.xyz/")
47
- #CLIENT.authenticate_with_token(token=userdata.get(speckleToken))
48
-
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,13 +124,6 @@ def get_page_by_id(notion_db_pages, page_id):
142
  return pg
143
 
144
 
145
- from config import landuseColumnName
146
- from config import subdomainColumnName
147
- from config import sqmPerEmployeeColumnName
148
- from config import thresholdsColumnName
149
- from config import maxPointsColumnName
150
- from config import domainColumnName
151
-
152
 
153
  def fetchDomainMapper (luAttributePages):
154
 
@@ -167,7 +142,6 @@ def fetchDomainMapper (luAttributePages):
167
  return lu_domain_mapper
168
 
169
 
170
-
171
  def fetchSubdomainMapper (livabilityAttributePages):
172
 
173
  attribute_mapper ={}
@@ -194,8 +168,6 @@ def fetchSubdomainMapper (livabilityAttributePages):
194
 
195
 
196
 
197
-
198
-
199
 
200
  def fetchDistanceMatrices (stream_distance_matrices):
201
 
 
1
  import sys
2
 
 
3
  from specklepy.api.client import SpeckleClient
4
  from specklepy.api.credentials import get_default_account, get_local_accounts
5
  from specklepy.transports.server import ServerTransport
 
7
  from specklepy.objects.geometry import Polyline, Point
8
  from specklepy.objects import Base
9
 
 
10
  import numpy as np
11
  import pandas as pd
12
  import matplotlib.pyplot as plt
 
13
  import math
14
  import matplotlib
 
 
15
  import json
16
 
17
  from notion_client import Client
18
  import os
19
 
20
+ notionToken = os.getenv('notionToken')
 
 
 
21
  notion = Client(auth=notion_token)
22
+ speckleToken = os.getenv('speckleToken')
23
 
24
+ from config import landuseColumnName
25
+ from config import subdomainColumnName
26
+ from config import sqmPerEmployeeColumnName
27
+ from config import thresholdsColumnName
28
+ from config import maxPointsColumnName
29
+ from config import domainColumnName
30
 
31
 
32
  # ----------------------------------------------------------------------------------
33
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  # query full database
37
  def fetch_all_database_pages(client, database_id):
 
124
  return pg
125
 
126
 
 
 
 
 
 
 
 
127
 
128
  def fetchDomainMapper (luAttributePages):
129
 
 
142
  return lu_domain_mapper
143
 
144
 
 
145
  def fetchSubdomainMapper (livabilityAttributePages):
146
 
147
  attribute_mapper ={}
 
168
 
169
 
170
 
 
 
171
 
172
  def fetchDistanceMatrices (stream_distance_matrices):
173