streamlit-octostar-utils 0.1.7a11__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,7 +163,6 @@ def compute_ner(
163
163
  entities += flair_entities
164
164
  del flair_entities
165
165
 
166
- print("Checking REGEXES")
167
166
  # REGEX model
168
167
  for label, regexes in REGEX_NER_MODELS.items():
169
168
  if not isinstance(regexes, list):
@@ -183,7 +182,6 @@ def compute_ner(
183
182
  min_score = min([min_score] + [e.score for e in regex_entities])
184
183
 
185
184
  # SPACY model
186
- print("CHECKING SPACY")
187
185
  chunks = []
188
186
  chunk_start_offsets = []
189
187
  current_chunk = []
@@ -1,12 +1,10 @@
1
1
  from octostar.client import make_client, UserContext, User
2
2
  from functools import wraps
3
- from streamlit_octostar_research.desktop import whoami
3
+ from octostar_streamlit.desktop import whoami
4
4
  from streamlit.runtime.scriptrunner import get_script_run_ctx
5
5
  import hashlib
6
6
  import streamlit as st
7
7
  import time
8
- import base64
9
- import json
10
8
 
11
9
 
12
10
  def impersonating_running_user(**client_kwargs):
@@ -27,14 +25,13 @@ def as_running_user(force_refresh=False):
27
25
  script_ctx = get_script_run_ctx()
28
26
  current_time = time.time()
29
27
 
30
- def should_refresh():
31
- return (
32
- force_refresh
33
- or id(script_ctx.script_requests) != session.get("prev_run_id")
34
- or current_time > session.get("token_expiry", 0) - 300 # 5 minutes buffer
35
- )
28
+ should_refresh = (
29
+ force_refresh
30
+ or script_ctx.script_requests is not session.get("prev_run")
31
+ or current_time > session.get("token_expiry", 0) - 300 # 5 minutes buffer
32
+ )
36
33
 
37
- if not should_refresh() and "prev_user" in session:
34
+ if not should_refresh and "prev_user" in session:
38
35
  return UserContext(session["prev_user"])
39
36
 
40
37
  running_user = whoami()
@@ -52,5 +49,5 @@ def as_running_user(force_refresh=False):
52
49
  session["prev_user"] = user
53
50
  session["token_expiry"] = user.jwt_expires_at
54
51
 
55
- session["prev_run_id"] = id(script_ctx.script_requests)
52
+ session["prev_run"] = script_ctx.script_requests
56
53
  return UserContext(session["prev_user"])
@@ -1,6 +1,6 @@
1
1
  import streamlit as st
2
2
 
3
- from streamlit_octostar_research.desktop import get_open_workspace_ids
3
+ from octostar_streamlit.desktop import get_open_workspace_ids
4
4
  from octostar.utils.ontology import query_ontology
5
5
  from octostar.utils.workspace.permissions import get_permissions, PermissionLevel
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: streamlit-octostar-utils
3
- Version: 0.1.7a11
3
+ Version: 0.2.0
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Octostar
@@ -21,6 +21,7 @@ Requires-Dist: flair (==0.13.1) ; extra == "nlp"
21
21
  Requires-Dist: iso639 (>=0.1.0) ; extra == "nlp"
22
22
  Requires-Dist: nltk (>=3.8.0,<4.0.0) ; extra == "nlp"
23
23
  Requires-Dist: numpy (>=1.20.0)
24
+ Requires-Dist: octostar-streamlit (>=0.1.25,<0.2.0)
24
25
  Requires-Dist: pottery (>=3.0.0,<4.0.0)
25
26
  Requires-Dist: py3langid (>=0.2.0,<0.3.0) ; extra == "nlp"
26
27
  Requires-Dist: pydantic (>=2.6.4,<3.0.0)
@@ -33,7 +34,6 @@ Requires-Dist: sortedcontainers (>=2.0.0)
33
34
  Requires-Dist: spacy (>=3.7.0,<4.0.0) ; extra == "nlp"
34
35
  Requires-Dist: spacy-download (==1.1.0) ; extra == "nlp"
35
36
  Requires-Dist: streamlit (>=1.33.0,<2.0.0)
36
- Requires-Dist: streamlit-octostar-research (>=0.1.22,<0.2.0)
37
37
  Requires-Dist: sumy (>=0.11.0,<1.0.0) ; extra == "nlp"
38
38
  Description-Content-Type: text/markdown
39
39
 
@@ -19,14 +19,13 @@ streamlit_octostar_utils/core/filetypes.py,sha256=C4h4WDU8voMIdQETC3n1cd-CDgw9aN
19
19
  streamlit_octostar_utils/core/threading/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
20
  streamlit_octostar_utils/core/threading/key_queue.py,sha256=7CJpj0gvZMQd8eC5wKQi3Ak5SQQ4zQ1OPTs_OP_kD20,2255
21
21
  streamlit_octostar_utils/core/timestamp.py,sha256=a3s4xfm1nctLzYsHOJxqoWIDTdbNY_yN1OByl8ahLc8,383
22
- streamlit_octostar_utils/hello.py,sha256=JVeug8fnyYYf_qw6eeMDBrdqsSkiwnSHdPvb9puEGdA,69
23
22
  streamlit_octostar_utils/nlp/__init__.py,sha256=BtlYDZK_xaEbc7Ju_7MznXbCVPZcdLn26xwR9qf_UhM,336
24
23
  streamlit_octostar_utils/nlp/language.py,sha256=13f6kAALYjC3EclBzcyKPd4GlIeIR1mWPu3S6d-z814,549
25
- streamlit_octostar_utils/nlp/ner.py,sha256=lw4VGJQHCJAudQvBJszJ0MYG-JGL-5-Y25wLY5ky6bU,13384
24
+ streamlit_octostar_utils/nlp/ner.py,sha256=EAx4WNCH3jO9KQlK47hG3RMjnNpFadGl7CKfCQmSM7c,13326
26
25
  streamlit_octostar_utils/octostar/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
27
- streamlit_octostar_utils/octostar/client.py,sha256=29tA1LY9ndLzAMR_KlL7Jb071YNAanubsppzy2BXb1E,1779
26
+ streamlit_octostar_utils/octostar/client.py,sha256=2oyU3ZJp4a7GxFM3qH5UVzu2KQm2kSSjzFlqG6t6G2Q,1696
28
27
  streamlit_octostar_utils/octostar/context.py,sha256=TpucK48EbeVy4vDqKd9UULEtr1JOY-_4nBs-rXZzESw,212
29
- streamlit_octostar_utils/octostar/permissions.py,sha256=xa3yLuvFayjD1HH-9v8hYPrWOzBxK_WRr66Y4CKx-Kk,1574
28
+ streamlit_octostar_utils/octostar/permissions.py,sha256=G5nZQLR-k-5_Xeto4nDTb32828Ga-SHm1mvSB9tz-t4,1565
30
29
  streamlit_octostar_utils/ontology/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
31
30
  streamlit_octostar_utils/ontology/expand_entities.py,sha256=bBt32Dnts3VSzu13QQtPyfYe05IRodD9WfnhNTiBg_w,22749
32
31
  streamlit_octostar_utils/ontology/inheritance.py,sha256=oSd6xDAlmI7iYOv3VJ7t8CRN2zK7_Cln26YHS20qAqw,138
@@ -37,7 +36,7 @@ streamlit_octostar_utils/threading/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzp
37
36
  streamlit_octostar_utils/threading/async_task_manager.py,sha256=q7N6YZwUvIYMzkSHmsJNheNVCv93c03H6Hyg9uH8pvk,4747
38
37
  streamlit_octostar_utils/threading/session_callback_manager.py,sha256=LvZVP4g6tvKtYmI13f2j1sX_7hm61Groqp5xJine9_k,3973
39
38
  streamlit_octostar_utils/threading/session_state_hot_swapper.py,sha256=6eeCQI6A42hp4DmW2NQw2rbeR-k9N8DhfBKQdN_fbLU,811
40
- streamlit_octostar_utils-0.1.7a11.dist-info/LICENSE,sha256=dkwVPyV03fPHHtERnF6RnvRXcll__tud9gWca1RcgnQ,1073
41
- streamlit_octostar_utils-0.1.7a11.dist-info/METADATA,sha256=sh4TvXiQ_9cxohuhsa_MuY8kcqGJZ2GnVBNCVRXpbpc,2268
42
- streamlit_octostar_utils-0.1.7a11.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
43
- streamlit_octostar_utils-0.1.7a11.dist-info/RECORD,,
39
+ streamlit_octostar_utils-0.2.0.dist-info/LICENSE,sha256=dkwVPyV03fPHHtERnF6RnvRXcll__tud9gWca1RcgnQ,1073
40
+ streamlit_octostar_utils-0.2.0.dist-info/METADATA,sha256=CfGrV-aE4V02HSNDBHec34ngZR7tLSrAmCR0eyKKNRQ,2256
41
+ streamlit_octostar_utils-0.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
42
+ streamlit_octostar_utils-0.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,2 +0,0 @@
1
- def hello():
2
- print("Hello world from streamlit-octostar-utils!")