fleet-python 0.2.58__py3-none-any.whl → 0.2.59__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.

Potentially problematic release.


This version of fleet-python might be problematic. Click here for more details.

fleet/__init__.py CHANGED
@@ -53,6 +53,7 @@ from ._async.tasks import (
53
53
  load_tasks_from_file as load_tasks_from_file_async,
54
54
  import_task as import_task_async,
55
55
  import_tasks as import_tasks_async,
56
+ get_task as get_task_async,
56
57
  )
57
58
 
58
59
  # Import sync task functions
@@ -61,6 +62,7 @@ from .tasks import (
61
62
  load_tasks_from_file,
62
63
  import_task,
63
64
  import_tasks,
65
+ get_task,
64
66
  )
65
67
 
66
68
  # Import shared types
@@ -117,6 +119,8 @@ __all__ = [
117
119
  "import_task_async",
118
120
  "import_tasks",
119
121
  "import_tasks_async",
122
+ "get_task",
123
+ "get_task_async",
120
124
  # Version
121
125
  "__version__",
122
126
  ]
fleet/_async/__init__.py CHANGED
@@ -89,6 +89,7 @@ __all__ = [
89
89
  "import_task",
90
90
  "import_tasks",
91
91
  "account",
92
+ "get_task",
92
93
  # Version
93
94
  "__version__",
94
95
  ]
@@ -228,6 +229,22 @@ async def account() -> AccountResponse:
228
229
  return await _async_global_client.get_client().account()
229
230
 
230
231
 
232
+ async def get_task(task_key: str, version_id: Optional[str] = None):
233
+ """Get a task by key and optional version.
234
+
235
+ Args:
236
+ task_key: The key of the task to retrieve
237
+ version_id: Optional version ID to filter by
238
+
239
+ Example:
240
+ task = await fleet.get_task("my-task")
241
+ task = await fleet.get_task("my-task", version_id="v1")
242
+ """
243
+ return await _async_global_client.get_client().get_task(
244
+ task_key=task_key, version_id=version_id
245
+ )
246
+
247
+
231
248
  def configure(
232
249
  api_key: Optional[str] = None,
233
250
  base_url: Optional[str] = None,
fleet/_async/client.py CHANGED
@@ -717,6 +717,29 @@ class AsyncFleet:
717
717
  )
718
718
  return TaskResponse(**response.json())
719
719
 
720
+ async def get_task(
721
+ self,
722
+ task_key: str,
723
+ version_id: Optional[str] = None,
724
+ ) -> TaskResponse:
725
+ """Get a task by key and optional version.
726
+
727
+ Args:
728
+ task_key: The key of the task to retrieve
729
+ version_id: Optional version ID to filter by
730
+
731
+ Returns:
732
+ TaskResponse containing the task details
733
+ """
734
+ params = {}
735
+ if version_id is not None:
736
+ params["version_id"] = version_id
737
+
738
+ response = await self.client.request(
739
+ "GET", f"/v1/tasks/{task_key}", params=params
740
+ )
741
+ return TaskResponse(**response.json())
742
+
720
743
  async def _create_verifier_from_data(
721
744
  self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
722
745
  ) -> "AsyncVerifierFunction":
fleet/_async/tasks.py CHANGED
@@ -389,6 +389,26 @@ async def update_task(
389
389
  )
390
390
 
391
391
 
392
+ async def get_task(task_key: str, version_id: Optional[str] = None):
393
+ """Convenience function to get a task by key and optional version.
394
+
395
+ Args:
396
+ task_key: The key of the task to retrieve
397
+ version_id: Optional version ID to filter by
398
+
399
+ Returns:
400
+ TaskResponse containing the task details
401
+
402
+ Examples:
403
+ response = await fleet.get_task("my-task")
404
+ response = await fleet.get_task("my-task", version_id="v1")
405
+ """
406
+ from .global_client import get_client
407
+
408
+ client = get_client()
409
+ return await client.get_task(task_key=task_key, version_id=version_id)
410
+
411
+
392
412
  async def import_task(task: Task, project_key: Optional[str] = None):
393
413
  """Convenience function to import a single task.
394
414
 
fleet/client.py CHANGED
@@ -715,6 +715,29 @@ class Fleet:
715
715
  )
716
716
  return TaskResponse(**response.json())
717
717
 
718
+ def get_task(
719
+ self,
720
+ task_key: str,
721
+ version_id: Optional[str] = None,
722
+ ) -> TaskResponse:
723
+ """Get a task by key and optional version.
724
+
725
+ Args:
726
+ task_key: The key of the task to retrieve
727
+ version_id: Optional version ID to filter by
728
+
729
+ Returns:
730
+ TaskResponse containing the task details
731
+ """
732
+ params = {}
733
+ if version_id is not None:
734
+ params["version_id"] = version_id
735
+
736
+ response = self.client.request(
737
+ "GET", f"/v1/tasks/{task_key}", params=params
738
+ )
739
+ return TaskResponse(**response.json())
740
+
718
741
  def _create_verifier_from_data(
719
742
  self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
720
743
  ) -> "SyncVerifierFunction":
fleet/tasks.py CHANGED
@@ -390,6 +390,26 @@ def update_task(
390
390
  )
391
391
 
392
392
 
393
+ def get_task(task_key: str, version_id: Optional[str] = None):
394
+ """Convenience function to get a task by key and optional version.
395
+
396
+ Args:
397
+ task_key: The key of the task to retrieve
398
+ version_id: Optional version ID to filter by
399
+
400
+ Returns:
401
+ TaskResponse containing the task details
402
+
403
+ Examples:
404
+ response = fleet.get_task("my-task")
405
+ response = fleet.get_task("my-task", version_id="v1")
406
+ """
407
+ from .global_client import get_client
408
+
409
+ client = get_client()
410
+ return client.get_task(task_key=task_key, version_id=version_id)
411
+
412
+
393
413
  def import_task(task: Task, project_key: Optional[str] = None):
394
414
  """Convenience function to import a single task.
395
415
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.58
3
+ Version: 0.2.59
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -21,22 +21,22 @@ examples/openai_simple_example.py,sha256=HmiufucrAZne7tHq9uoEsDWlEhjNC265bQAyIGB
21
21
  examples/query_builder_example.py,sha256=-cOMfWGNifYfYEt_Ds73XpwATZvFDL6F4KTkVxdMjzg,3951
22
22
  examples/quickstart.py,sha256=1VT39IRRhemsJgxi0O0gprdpcw7HB4pYO97GAYagIcg,3788
23
23
  examples/test_cdp_logging.py,sha256=AkCwQCgOTQEI8w3v0knWK_4eXMph7L9x07wj9yIYM10,2836
24
- fleet/__init__.py,sha256=fwIcuaJPPdLMdKPsazfz4EAPeJchl9MBN4nxs0YlOjw,4117
24
+ fleet/__init__.py,sha256=yC4HIcbtPAPOgI0lLri3l8nbXkNee9JOihKAc7SXYkY,4201
25
25
  fleet/base.py,sha256=bc-340sTpq_DJs7yQ9d2pDWnmJFmA1SwDB9Lagvqtb4,9182
26
- fleet/client.py,sha256=gvJYF1Y3hG4DHM0PPuCHVbID-aSVK_oIT84aAY8lhQU,31244
26
+ fleet/client.py,sha256=kpaKJf4J9fuKFQt2ANhh66xKl4qUCDERPoxVLGkM0Wo,31882
27
27
  fleet/config.py,sha256=uY02ZKxVoXqVDta-0IMWaYJeE1CTXF_fA9NI6QUutmU,319
28
28
  fleet/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
29
29
  fleet/global_client.py,sha256=frrDAFNM2ywN0JHLtlm9qbE1dQpnQJsavJpb7xSR_bU,1072
30
30
  fleet/models.py,sha256=d9eish0KO3t4VCNu8h8Q_6K1Xj-crYo5Fejtle0Ur28,13056
31
- fleet/tasks.py,sha256=PqOlJBM5b-qwto_nrOXzLvfLJ7B4fGq05Eg-0kDNFv8,15681
31
+ fleet/tasks.py,sha256=WK5l2ZJtSyySepfeqmA8Zb0m7ENtNRIuECjBE1EwC3Y,16262
32
32
  fleet/types.py,sha256=L4Y82xICf1tzyCLqhLYUgEoaIIS5h9T05TyFNHSWs3s,652
33
- fleet/_async/__init__.py,sha256=ruGtdMl9BRQRsJygNszPT89ZbMy6AYv1mmeYoB--r60,7557
33
+ fleet/_async/__init__.py,sha256=Wi8Tjj-Lfnxi4cPOkAxh2lynnpEBNni6mI6Iq80uOro,8054
34
34
  fleet/_async/base.py,sha256=oisVTQsx0M_yTmyQJc3oij63uKZ97MHz-xYFsWXxQE8,9202
35
- fleet/_async/client.py,sha256=NxYb4jVBLO3f3eL_1x7z-nkZusFHllFQdgUunUfCwSw,31680
35
+ fleet/_async/client.py,sha256=Lc6YilhZL8gyQxs6wTiSd5Z9NyIPzHTOfNxcgucmeLo,32330
36
36
  fleet/_async/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
37
37
  fleet/_async/global_client.py,sha256=4WskpLHbsDEgWW7hXMD09W-brkp4euy8w2ZJ88594rQ,1103
38
38
  fleet/_async/models.py,sha256=GX-sRciZDenW2O7Qx9w_ftOkJyE4ph1-92WMq6lynHE,12856
39
- fleet/_async/tasks.py,sha256=wYCSmCDs9svXWXmIKp55I2bf6-85VkTWpJo0pZmOUJ0,15679
39
+ fleet/_async/tasks.py,sha256=Uy73jhApo3QsbcMZO0JLOZYxawFt023N8GjDFZCOi98,16284
40
40
  fleet/_async/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  fleet/_async/env/client.py,sha256=C5WG5Ir_McXaFPZNdkQjj0w4V7xMIcw3QyVP5g-3kVk,1237
42
42
  fleet/_async/instance/__init__.py,sha256=PtmJq8J8bh0SOQ2V55QURz5GJfobozwtQoqhaOk3_tI,515
@@ -69,10 +69,10 @@ fleet/verifiers/decorator.py,sha256=nAP3O8szXu7md_kpwpz91hGSUNEVLYjwZQZTkQlV1DM,
69
69
  fleet/verifiers/parse.py,sha256=qz9AfJrTbjlg-LU-lE8Ciqi7Yt2a8-cs17FdpjTLhMk,8550
70
70
  fleet/verifiers/sql_differ.py,sha256=TqTLWyK3uOyLbitT6HYzYEzuSFC39wcyhgk3rcm__k8,6525
71
71
  fleet/verifiers/verifier.py,sha256=_lcxXVm8e0xRrK2gNJy9up7pW1zOkPRY5n5lQ85S8jg,14197
72
- fleet_python-0.2.58.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ fleet_python-0.2.59.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
73
  scripts/fix_sync_imports.py,sha256=X9fWLTpiPGkSHsjyQUDepOJkxOqw1DPj7nd8wFlFqLQ,8368
74
74
  scripts/unasync.py,sha256=vWVQxRWX8SRZO5cmzEhpvnG_REhCWXpidIGIpWmEcvI,696
75
- fleet_python-0.2.58.dist-info/METADATA,sha256=wMsd79uNixxkzRCfBNmI2xdVsEz4TeHA2ZFnl_wwos4,3304
76
- fleet_python-0.2.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
- fleet_python-0.2.58.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
78
- fleet_python-0.2.58.dist-info/RECORD,,
75
+ fleet_python-0.2.59.dist-info/METADATA,sha256=9FfVHwYOe1gh_bawQQvO6Ilg9AyrUUmxk2mF4db1Buk,3304
76
+ fleet_python-0.2.59.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
+ fleet_python-0.2.59.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
78
+ fleet_python-0.2.59.dist-info/RECORD,,