dragoneye-python 1.0.1__tar.gz → 1.0.2__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 (21) hide show
  1. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/PKG-INFO +1 -1
  2. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/dragoneye_python.egg-info/PKG-INFO +1 -1
  3. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/pyproject.toml +1 -1
  4. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/classification.py +9 -5
  5. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/client.py +3 -0
  6. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/LICENSE +0 -0
  7. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/README.md +0 -0
  8. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/dragoneye_python.egg-info/SOURCES.txt +0 -0
  9. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/dragoneye_python.egg-info/dependency_links.txt +0 -0
  10. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/dragoneye_python.egg-info/requires.txt +0 -0
  11. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/dragoneye_python.egg-info/top_level.txt +0 -0
  12. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/requirements.txt +0 -0
  13. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/setup.cfg +0 -0
  14. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/__init__.py +0 -0
  15. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/constants.py +0 -0
  16. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/models.py +0 -0
  17. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/parquet_deserializer.py +0 -0
  18. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/types/__init__.py +0 -0
  19. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/types/common.py +0 -0
  20. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/types/exception.py +0 -0
  21. {dragoneye_python-1.0.1 → dragoneye_python-1.0.2}/src/dragoneye/types/media.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragoneye-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Official Python SDK for the Dragoneye computer vision API
5
5
  Author-email: Dragoneye <support@dragoneye.ai>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragoneye-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Official Python SDK for the Dragoneye computer vision API
5
5
  Author-email: Dragoneye <support@dragoneye.ai>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dragoneye-python"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "Official Python SDK for the Dragoneye computer vision API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -21,7 +21,6 @@ from .parquet_deserializer import (
21
21
  deserialize_video_predictions,
22
22
  )
23
23
  from .types.common import (
24
- BASE_API_URL,
25
24
  PredictionTaskState,
26
25
  PredictionTaskUUID,
27
26
  PredictionType,
@@ -136,7 +135,7 @@ class Classification:
136
135
  Given a prediction task UUID, return
137
136
  """
138
137
  query = urlencode({"predictionTaskUuid": prediction_task_uuid})
139
- url = f"{BASE_API_URL}/prediction-task/status?{query}"
138
+ url = f"{self._client.base_api_url}/prediction-task/status?{query}"
140
139
  headers = {"X-API-Key": self._client.api_key}
141
140
 
142
141
  @self._backoff_on_429
@@ -200,7 +199,7 @@ class Classification:
200
199
  "response_version": "parquet",
201
200
  }
202
201
  )
203
- url = f"{BASE_API_URL}/prediction-task/results?{query}"
202
+ url = f"{self._client.base_api_url}/prediction-task/results?{query}"
204
203
  headers = {"X-API-Key": self._client.api_key}
205
204
 
206
205
  @self._backoff_on_429
@@ -284,13 +283,14 @@ class Classification:
284
283
  mime_type=media.mime_type,
285
284
  frames_per_second=frames_per_second,
286
285
  file_name=media.name,
286
+ **kwargs,
287
287
  )
288
288
 
289
289
  await self._upload_media_to_prediction_task(
290
290
  media, prediction_task_begin_response.signed_urls[0]
291
291
  )
292
292
 
293
- predict_url = f"{BASE_API_URL}/predict"
293
+ predict_url = f"{self._client.base_api_url}/predict"
294
294
  predict_data: dict[str, Any] = {
295
295
  "model_name": model_name,
296
296
  "prediction_task_uuid": prediction_task_begin_response.prediction_task_uuid,
@@ -385,8 +385,9 @@ class Classification:
385
385
  mime_type: str,
386
386
  frames_per_second: Optional[int],
387
387
  file_name: Optional[str],
388
+ **kwargs: Any,
388
389
  ) -> _PredictionTaskBeginResponse:
389
- url = f"{BASE_API_URL}/prediction-task/begin"
390
+ url = f"{self._client.base_api_url}/prediction-task/begin"
390
391
 
391
392
  form_data = aiohttp.FormData()
392
393
  form_data.add_field("mimetype", mime_type)
@@ -397,6 +398,9 @@ class Classification:
397
398
  if frames_per_second is not None:
398
399
  form_data.add_field("frames_per_second", str(frames_per_second))
399
400
 
401
+ for key, value in kwargs.items():
402
+ form_data.add_field(key, str(value))
403
+
400
404
  headers = {
401
405
  "X-API-Key": self._client.api_key,
402
406
  }
@@ -4,6 +4,7 @@ from typing import Callable, Optional
4
4
  import backoff
5
5
 
6
6
  from dragoneye.classification import Classification
7
+ from dragoneye.types.common import BASE_API_URL
7
8
 
8
9
 
9
10
  class Dragoneye:
@@ -13,6 +14,7 @@ class Dragoneye:
13
14
  max_retries: int = 10,
14
15
  max_backoff_time: int = 120,
15
16
  backoff_jitter: Callable[[float], float] = backoff.full_jitter,
17
+ base_api_url: str = BASE_API_URL,
16
18
  ):
17
19
  if api_key is None:
18
20
  api_key = os.getenv("DRAGONEYE_API_KEY")
@@ -25,5 +27,6 @@ class Dragoneye:
25
27
  self.max_retries = max_retries
26
28
  self.max_backoff_time = max_backoff_time
27
29
  self.backoff_jitter = backoff_jitter
30
+ self.base_api_url = base_api_url
28
31
 
29
32
  self.classification = Classification(self)