sentor-ml 1.0.2__py3-none-any.whl → 1.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.
- sentor/client.py +4 -4
- {sentor_ml-1.0.2.dist-info → sentor_ml-1.2.0.dist-info}/METADATA +4 -16
- sentor_ml-1.2.0.dist-info/RECORD +10 -0
- tests/test_client.py +1 -1
- sentor_ml-1.0.2.dist-info/RECORD +0 -10
- {sentor_ml-1.0.2.dist-info → sentor_ml-1.2.0.dist-info}/WHEEL +0 -0
- {sentor_ml-1.0.2.dist-info → sentor_ml-1.2.0.dist-info}/entry_points.txt +0 -0
- {sentor_ml-1.0.2.dist-info → sentor_ml-1.2.0.dist-info}/top_level.txt +0 -0
sentor/client.py
CHANGED
|
@@ -17,7 +17,7 @@ class SentorClient:
|
|
|
17
17
|
def __init__(
|
|
18
18
|
self,
|
|
19
19
|
api_key: str,
|
|
20
|
-
base_url: str = "https://
|
|
20
|
+
base_url: str = "https://sentor.app/api",
|
|
21
21
|
timeout: int = 30,
|
|
22
22
|
):
|
|
23
23
|
"""
|
|
@@ -49,13 +49,13 @@ class SentorClient:
|
|
|
49
49
|
if not documents:
|
|
50
50
|
raise ValueError("Input is required")
|
|
51
51
|
|
|
52
|
-
url = f"{self.base_url}/
|
|
52
|
+
url = f"{self.base_url}/predicts"
|
|
53
53
|
payload = {"docs": documents}
|
|
54
54
|
response = requests.post(
|
|
55
55
|
url, json=payload, headers=self.headers, timeout=self.timeout
|
|
56
56
|
)
|
|
57
57
|
|
|
58
|
-
if response.status_code == 200:
|
|
58
|
+
if response.status_code == 200 or response.status_code == 201:
|
|
59
59
|
return response.json()
|
|
60
60
|
elif response.status_code == 429:
|
|
61
61
|
raise RateLimitError(response.json())
|
|
@@ -73,7 +73,7 @@ class SentorClient:
|
|
|
73
73
|
Raises:
|
|
74
74
|
SentorAPIError: If health check fails
|
|
75
75
|
"""
|
|
76
|
-
url = f"{self.base_url}/health"
|
|
76
|
+
url = f"{self.base_url}/predicts/health"
|
|
77
77
|
response = requests.get(
|
|
78
78
|
url,
|
|
79
79
|
headers=self.headers,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sentor-ml
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A Python SDK for interacting with the Sentor ML API for sentiment analysis
|
|
5
5
|
Home-page: https://github.com/NIKX-Tech/sentor-ml-python-sdk
|
|
6
6
|
Author: NIKX Technologies
|
|
@@ -47,21 +47,9 @@ A Python SDK for interacting with the Sentor ML API for sentiment analysis. This
|
|
|
47
47
|
pip install sentor-ml
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
## Get API key
|
|
51
|
-
|
|
52
|
-
### Try with guest API key
|
|
53
|
-
Get a guest API key to try the API.
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
curl -X 'POST' \
|
|
57
|
-
'https://ml.sentor.app/api/auth/guest-access' \
|
|
58
|
-
-H 'accept: application/json' \
|
|
59
|
-
-d ''
|
|
60
|
-
```
|
|
61
|
-
|
|
62
50
|
### Work like a PRO
|
|
63
51
|
|
|
64
|
-
1. Go to [Sentor ML API](https://
|
|
52
|
+
1. Go to [Sentor ML API](https://sentor.app/api)
|
|
65
53
|
2. Subscribe to the Starter plan
|
|
66
54
|
3. Get your API key
|
|
67
55
|
|
|
@@ -209,8 +197,8 @@ print(result)
|
|
|
209
197
|
|
|
210
198
|
## API Reference
|
|
211
199
|
|
|
212
|
-
Please refer to the [Sentor ML API Documentation](https://
|
|
213
|
-
You can also try the API in the [Sentor ML API Swagger Playground](https://
|
|
200
|
+
Please refer to the [Sentor ML API Documentation](https://sentor.app/docs) for more details.
|
|
201
|
+
You can also try the API in the [Sentor ML API Swagger Playground](https://sentor.app/docs).
|
|
214
202
|
|
|
215
203
|
## Contributing
|
|
216
204
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
sentor/__init__.py,sha256=K0z9SVT_Bkif2bj3Yqr7QtvQNTJll6an3DCuE0-rD0c,64
|
|
2
|
+
sentor/client.py,sha256=lonitKFt2I0z4K3ok26L2gobbwuDCWFIZxb985YLPPg,2554
|
|
3
|
+
sentor/exceptions.py,sha256=MY5uFUJd_WBhCMc0zNxVvoasC1rME4Brqv82MwhDM7c,648
|
|
4
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
tests/test_client.py,sha256=QMCyMt1n5e_-guT3yf5yVk_vKssHjkaGBuKd18ZixKg,4098
|
|
6
|
+
sentor_ml-1.2.0.dist-info/METADATA,sha256=gLnTitSAnJCE4EVpQTOBE5lVBgwm3OuPAGAzVjXbgVE,6525
|
|
7
|
+
sentor_ml-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
sentor_ml-1.2.0.dist-info/entry_points.txt,sha256=iYoIGXM8AusRG36JhqnBREngOd0iDOYN0C8PpiHtgXE,46
|
|
9
|
+
sentor_ml-1.2.0.dist-info/top_level.txt,sha256=nVfiI7y35XyGm5wyA94o24nDInXLiheycaaRtkR10ko,13
|
|
10
|
+
sentor_ml-1.2.0.dist-info/RECORD,,
|
tests/test_client.py
CHANGED
|
@@ -20,7 +20,7 @@ def test_client_initialization():
|
|
|
20
20
|
client = SentorClient(api_key="test-key")
|
|
21
21
|
assert isinstance(client, SentorClient)
|
|
22
22
|
assert client.api_key == "test-key"
|
|
23
|
-
assert client.base_url == "https://
|
|
23
|
+
assert client.base_url == "https://sentor.app/api"
|
|
24
24
|
assert client.timeout == 30
|
|
25
25
|
|
|
26
26
|
|
sentor_ml-1.0.2.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
sentor/__init__.py,sha256=K0z9SVT_Bkif2bj3Yqr7QtvQNTJll6an3DCuE0-rD0c,64
|
|
2
|
-
sentor/client.py,sha256=6Sps6UFLmUaEiE69yY8C537OQTtLteGLROs3N6om5Ss,2519
|
|
3
|
-
sentor/exceptions.py,sha256=MY5uFUJd_WBhCMc0zNxVvoasC1rME4Brqv82MwhDM7c,648
|
|
4
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
tests/test_client.py,sha256=kuhFtgwehMGqC0JKJfzAvqEl6UTvYo2nZDNa7YRF4rs,4101
|
|
6
|
-
sentor_ml-1.0.2.dist-info/METADATA,sha256=pAP0tLMpvTQzfGc2osGYpG9lmAz-4u1SQ9IO-SZB4WA,6751
|
|
7
|
-
sentor_ml-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
sentor_ml-1.0.2.dist-info/entry_points.txt,sha256=iYoIGXM8AusRG36JhqnBREngOd0iDOYN0C8PpiHtgXE,46
|
|
9
|
-
sentor_ml-1.0.2.dist-info/top_level.txt,sha256=nVfiI7y35XyGm5wyA94o24nDInXLiheycaaRtkR10ko,13
|
|
10
|
-
sentor_ml-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|