streamlit-octostar-utils 0.1.7a11__tar.gz → 0.2.1__tar.gz

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.
Files changed (43) hide show
  1. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/PKG-INFO +2 -2
  2. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/pyproject.toml +2 -2
  3. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/nlp/ner.py +0 -2
  4. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/octostar/client.py +10 -13
  5. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/octostar/permissions.py +1 -1
  6. streamlit_octostar_utils-0.1.7a11/streamlit_octostar_utils/hello.py +0 -2
  7. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/LICENSE +0 -0
  8. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/README.md +0 -0
  9. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/__init__.py +0 -0
  10. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
  11. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/celery.py +0 -0
  12. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
  13. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/nifi.py +0 -0
  14. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
  15. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
  16. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
  17. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
  18. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
  19. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
  20. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
  21. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
  22. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
  23. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
  24. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/__init__.py +0 -0
  25. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/dict.py +0 -0
  26. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/filetypes.py +0 -0
  27. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
  28. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
  29. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/core/timestamp.py +0 -0
  30. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/nlp/__init__.py +0 -0
  31. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/nlp/language.py +0 -0
  32. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/octostar/__init__.py +0 -0
  33. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/octostar/context.py +0 -0
  34. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/ontology/__init__.py +0 -0
  35. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/ontology/expand_entities.py +0 -0
  36. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
  37. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/ontology/validation.py +0 -0
  38. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/style/__init__.py +0 -0
  39. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/style/common.py +0 -0
  40. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/threading/__init__.py +0 -0
  41. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
  42. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
  43. {streamlit_octostar_utils-0.1.7a11 → streamlit_octostar_utils-0.2.1}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
@@ -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.1
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
 
@@ -5,7 +5,7 @@ include = '\.pyi?$'
5
5
 
6
6
  [tool.poetry]
7
7
  name = "streamlit-octostar-utils"
8
- version = "0.1.7a11"
8
+ version = "0.2.1"
9
9
  description = ""
10
10
  license = "MIT"
11
11
  authors = ["Octostar"]
@@ -29,7 +29,7 @@ warn_unused_ignores = true
29
29
  python = ">=3.9,<3.9.7 || >3.9.7,<4.0"
30
30
  pydantic = "^2.6.4"
31
31
  streamlit = "^1.33.0"
32
- streamlit-octostar-research = "^0.1.22"
32
+ octostar-streamlit = "^0.1.25"
33
33
  fastapi = ">=0.110.1, <1.0.0"
34
34
  python-multipart = "^0.0.9"
35
35
  sortedcontainers = ">=2.0.0"
@@ -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()
@@ -45,12 +42,12 @@ def as_running_user(force_refresh=False):
45
42
  else st.stop()
46
43
  )
47
44
 
48
- user_hash = int(hashlib.md5(running_user["os_jwt"].encode("utf-8")).hexdigest(), 16)
45
+ user_hash = int(hashlib.md5(running_user.os_jwt.encode("utf-8")).hexdigest(), 16)
49
46
  if "prev_user" not in session or hash(session["prev_user"]) != user_hash:
50
- client = make_client(fixed_jwt=running_user["os_jwt"])
47
+ client = make_client(fixed_jwt=running_user.os_jwt)
51
48
  user = User(client)
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,2 +0,0 @@
1
- def hello():
2
- print("Hello world from streamlit-octostar-utils!")