most-client 1.0.13__tar.gz → 1.0.14__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: most-client
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: Most AI API for https://the-most.ai
5
5
  Home-page: https://github.com/the-most-ai/most-client
6
6
  Author: George Kasparyants
@@ -26,7 +26,6 @@ Requires-Dist: pytest
26
26
  Requires-Dist: tox
27
27
  Requires-Dist: twine
28
28
  Requires-Dist: httpx
29
- Requires-Dist: bson==0.5.10
30
29
  Dynamic: author
31
30
  Dynamic: author-email
32
31
  Dynamic: classifier
@@ -1,6 +1,5 @@
1
+ import re
1
2
  from dataclasses import dataclass
2
-
3
- from bson import ObjectId
4
3
  from dataclasses_json import dataclass_json, DataClassJsonMixin
5
4
  from typing import Optional, List, Literal, Dict
6
5
 
@@ -77,6 +76,13 @@ class Result(DataClassJsonMixin):
77
76
  for column_result in self.results])
78
77
 
79
78
 
79
+ def is_valid_objectid(oid: str) -> bool:
80
+ """
81
+ Check if a given string is a valid MongoDB ObjectId (24-character hex).
82
+ """
83
+ return bool(re.fullmatch(r"^[0-9a-fA-F]{24}$", oid))
84
+
85
+
80
86
  def is_valid_id(smth_id: Optional[str]) -> bool:
81
87
  if smth_id is None:
82
88
  return False
@@ -84,8 +90,4 @@ def is_valid_id(smth_id: Optional[str]) -> bool:
84
90
  if smth_id.startswith("most-"):
85
91
  smth_id = smth_id[5:]
86
92
 
87
- try:
88
- ObjectId(smth_id)
89
- return True
90
- except:
91
- return False
93
+ return is_valid_objectid(smth_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: most-client
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: Most AI API for https://the-most.ai
5
5
  Home-page: https://github.com/the-most-ai/most-client
6
6
  Author: George Kasparyants
@@ -26,7 +26,6 @@ Requires-Dist: pytest
26
26
  Requires-Dist: tox
27
27
  Requires-Dist: twine
28
28
  Requires-Dist: httpx
29
- Requires-Dist: bson==0.5.10
30
29
  Dynamic: author
31
30
  Dynamic: author-email
32
31
  Dynamic: classifier
@@ -12,4 +12,3 @@ pytest
12
12
  tox
13
13
  twine
14
14
  httpx
15
- bson==0.5.10
@@ -12,4 +12,3 @@ pytest
12
12
  tox
13
13
  twine
14
14
  httpx
15
- bson==0.5.10
@@ -8,7 +8,7 @@ with open('requirements.txt', 'r') as f:
8
8
 
9
9
  setup(
10
10
  name='most-client',
11
- version='1.0.13',
11
+ version='1.0.14',
12
12
  python_requires=f'>=3.6',
13
13
  description='Most AI API for https://the-most.ai',
14
14
  url='https://github.com/the-most-ai/most-client',
File without changes
File without changes
File without changes
File without changes