hirundo 0.1.4__py3-none-any.whl → 0.1.6__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.
hirundo/__init__.py CHANGED
@@ -32,4 +32,4 @@ __all__ = [
32
32
  "StorageIntegration",
33
33
  ]
34
34
 
35
- __version__ = "0.1.4"
35
+ __version__ = "0.1.6"
@@ -1,9 +1,11 @@
1
1
  import json
2
2
  import logging
3
3
  from collections.abc import AsyncGenerator, Generator
4
+ from io import StringIO
4
5
  from typing import Union
5
6
 
6
7
  import httpx
8
+ import pandas as pd
7
9
  import requests
8
10
  from pydantic import BaseModel, Field, model_validator
9
11
 
@@ -234,6 +236,13 @@ class OptimizationDataset(BaseModel):
234
236
  self.dataset_id = None
235
237
  self.run_id = None
236
238
 
239
+ @staticmethod
240
+ def _read_csv_to_df(data: dict):
241
+ if data["state"] == "SUCCESS":
242
+ data["result"] = pd.read_csv(StringIO(data["result"]))
243
+ else:
244
+ pass
245
+
237
246
  @staticmethod
238
247
  def check_run_by_id(run_id: str, retry=0) -> Generator[dict, None, None]:
239
248
  """
@@ -272,7 +281,11 @@ class OptimizationDataset(BaseModel):
272
281
  sse.retry,
273
282
  )
274
283
  last_event = json.loads(sse.data)
275
- yield last_event["data"]
284
+ if not last_event:
285
+ continue
286
+ data = last_event["data"]
287
+ OptimizationDataset._read_csv_to_df(data)
288
+ yield data
276
289
  if not last_event or last_event["data"]["state"] == "PENDING":
277
290
  OptimizationDataset.check_run_by_id(run_id, retry + 1)
278
291
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hirundo
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: This package is used to interface with Hirundo's platform. It provides a simple API to optimize your ML datasets.
5
5
  Author-email: Hirundo <dev@hirundo.io>
6
6
  License: MIT License
@@ -21,41 +21,42 @@ Classifier: Programming Language :: Python :: 3
21
21
  Requires-Python: >=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: pyyaml >=6.0.1
25
- Requires-Dist: types-PyYAML >=6.0.12
26
- Requires-Dist: pydantic >=2.7.1
27
- Requires-Dist: twine >=5.0.0
28
- Requires-Dist: python-dotenv >=1.0.1
29
- Requires-Dist: types-requests >=2.31.0
30
- Requires-Dist: typer >=0.12.3
31
- Requires-Dist: httpx >=0.27.0
32
- Requires-Dist: stamina >=24.2.0
33
- Requires-Dist: httpx-sse >=0.4.0
24
+ Requires-Dist: pyyaml>=6.0.1
25
+ Requires-Dist: types-PyYAML>=6.0.12
26
+ Requires-Dist: pydantic>=2.7.1
27
+ Requires-Dist: twine>=5.0.0
28
+ Requires-Dist: python-dotenv>=1.0.1
29
+ Requires-Dist: types-requests>=2.31.0
30
+ Requires-Dist: typer>=0.12.3
31
+ Requires-Dist: httpx>=0.27.0
32
+ Requires-Dist: stamina>=24.2.0
33
+ Requires-Dist: httpx-sse>=0.4.0
34
+ Requires-Dist: pandas>=2.2.2
34
35
  Provides-Extra: dev
35
- Requires-Dist: pyyaml >=6.0.1 ; extra == 'dev'
36
- Requires-Dist: types-PyYAML >=6.0.12 ; extra == 'dev'
37
- Requires-Dist: pydantic >=2.7.1 ; extra == 'dev'
38
- Requires-Dist: twine >=5.0.0 ; extra == 'dev'
39
- Requires-Dist: python-dotenv >=1.0.1 ; extra == 'dev'
40
- Requires-Dist: types-requests >=2.31.0 ; extra == 'dev'
41
- Requires-Dist: types-setuptools >=69.5.0 ; extra == 'dev'
42
- Requires-Dist: typer >=0.12.3 ; extra == 'dev'
43
- Requires-Dist: httpx >=0.27.0 ; extra == 'dev'
44
- Requires-Dist: stamina >=24.2.0 ; extra == 'dev'
45
- Requires-Dist: httpx-sse >=0.4.0 ; extra == 'dev'
46
- Requires-Dist: pytest >=8.2.0 ; extra == 'dev'
47
- Requires-Dist: pytest-asyncio >=0.23.6 ; extra == 'dev'
48
- Requires-Dist: uv ; extra == 'dev'
49
- Requires-Dist: pre-commit >=3.7.1 ; extra == 'dev'
50
- Requires-Dist: ruff ; extra == 'dev'
51
- Requires-Dist: bumpver ; extra == 'dev'
36
+ Requires-Dist: pyyaml>=6.0.1; extra == "dev"
37
+ Requires-Dist: types-PyYAML>=6.0.12; extra == "dev"
38
+ Requires-Dist: pydantic>=2.7.1; extra == "dev"
39
+ Requires-Dist: twine>=5.0.0; extra == "dev"
40
+ Requires-Dist: python-dotenv>=1.0.1; extra == "dev"
41
+ Requires-Dist: types-requests>=2.31.0; extra == "dev"
42
+ Requires-Dist: types-setuptools>=69.5.0; extra == "dev"
43
+ Requires-Dist: typer>=0.12.3; extra == "dev"
44
+ Requires-Dist: httpx>=0.27.0; extra == "dev"
45
+ Requires-Dist: stamina>=24.2.0; extra == "dev"
46
+ Requires-Dist: httpx-sse>=0.4.0; extra == "dev"
47
+ Requires-Dist: pytest>=8.2.0; extra == "dev"
48
+ Requires-Dist: pytest-asyncio>=0.23.6; extra == "dev"
49
+ Requires-Dist: uv; extra == "dev"
50
+ Requires-Dist: pre-commit>=3.7.1; extra == "dev"
51
+ Requires-Dist: ruff; extra == "dev"
52
+ Requires-Dist: bumpver; extra == "dev"
52
53
  Provides-Extra: docs
53
- Requires-Dist: sphinx >=7.4.7 ; extra == 'docs'
54
- Requires-Dist: sphinx-autobuild >=2024.4.16 ; extra == 'docs'
55
- Requires-Dist: sphinx-click >=5.0.1 ; extra == 'docs'
56
- Requires-Dist: autodoc-pydantic >=2.2.0 ; extra == 'docs'
57
- Requires-Dist: furo ; extra == 'docs'
58
- Requires-Dist: sphinx-multiversion ; extra == 'docs'
54
+ Requires-Dist: sphinx>=7.4.7; extra == "docs"
55
+ Requires-Dist: sphinx-autobuild>=2024.4.16; extra == "docs"
56
+ Requires-Dist: sphinx-click>=5.0.1; extra == "docs"
57
+ Requires-Dist: autodoc-pydantic>=2.2.0; extra == "docs"
58
+ Requires-Dist: furo; extra == "docs"
59
+ Requires-Dist: sphinx-multiversion; extra == "docs"
59
60
 
60
61
  # Hirundo client
61
62
 
@@ -65,6 +66,8 @@ This repo contains the source code for the Hirundo client library
65
66
 
66
67
  To learn about how to use this library, please visit the [http://docs.hirundo.io/](documentation) or see the Google Colab examples.
67
68
 
69
+ Note: Currently we only support the main CPython release 3.9, 3.10 and 3.11. PyPy support may be introduced in the future.
70
+
68
71
  ## Development:
69
72
 
70
73
  ### Install dev dependencies
@@ -1,4 +1,4 @@
1
- hirundo/__init__.py,sha256=GArvHFmbEOlyod-0VByoQNT_9CLgwf69t1wJVigoyzo,707
1
+ hirundo/__init__.py,sha256=WeIIvtMy9ghxUKu1JyLcnVw1T1iQ9flQLDYpfqxb1g0,707
2
2
  hirundo/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
3
3
  hirundo/_constraints.py,sha256=-RAUV9GnCsaT9pLGSqYglKOeK0joPBBexGTo87j5nkI,425
4
4
  hirundo/_env.py,sha256=aObkRVLo9NBZiByd2FcoLrk3m8tnswuYzP4Tnj3EE-o,268
@@ -6,13 +6,13 @@ hirundo/_headers.py,sha256=htxHRjtD91C5D0svyk-zqhKV9LwQCEZauIa4ZTAfe5k,188
6
6
  hirundo/_iter_sse_retrying.py,sha256=WLp_lw8ycBuAxoJkkGBu4y74Ajhcu11r1X-vd5_571A,3352
7
7
  hirundo/_timeouts.py,sha256=IfX8-mrLp809-A_xSLv1DhIqZnO-Qvy4FcTtOtvqLog,42
8
8
  hirundo/cli.py,sha256=qj1Txt6lOU3V10SLtzH4uEWJ4DdkdOIEQaKn8wiJMss,3922
9
- hirundo/dataset_optimization.py,sha256=CLo9eclW_trDwzfr6uZlJ8JQb6XpWcKtACqSTaAF_fo,14583
9
+ hirundo/dataset_optimization.py,sha256=aeEbd5J9Xo8l_keYXQ8v26JfYI-6VSZveRgCQN9H11E,14970
10
10
  hirundo/enum.py,sha256=-3w09g-_yRYIMiM8VA_Nb07WoQXf5IjyERTGonzNDs0,457
11
11
  hirundo/git.py,sha256=GtowxPL78KleVhSY3QISu7-cUPrFbWC4YWBAuzuzryw,4731
12
12
  hirundo/storage.py,sha256=CxRdSnZGf4mtzNV2Ge_hwowd9pDP7NT9-xvWTbl187M,8185
13
- hirundo-0.1.4.dist-info/LICENSE,sha256=fusGGjqT2RGlU6kbkaOk7d-gDnsjk17wq67AO0mwBZI,1065
14
- hirundo-0.1.4.dist-info/METADATA,sha256=Vtt_XENI41nDyygK5kCMOaAGGQK0noCYdR6eJ6LEeE0,4428
15
- hirundo-0.1.4.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
16
- hirundo-0.1.4.dist-info/entry_points.txt,sha256=4ZtnA_Nl1Af8fLnHp3lwjbGDEGU1S6ujb_JwtuQ7ZPM,44
17
- hirundo-0.1.4.dist-info/top_level.txt,sha256=cmyNqrNZOAYxnywJGFI1AJBLe4SkH8HGsfFx6ncdrbI,8
18
- hirundo-0.1.4.dist-info/RECORD,,
13
+ hirundo-0.1.6.dist-info/LICENSE,sha256=fusGGjqT2RGlU6kbkaOk7d-gDnsjk17wq67AO0mwBZI,1065
14
+ hirundo-0.1.6.dist-info/METADATA,sha256=ILQyVMbnhMd7DuIw6RLldrxCbKI7pkrF46uE6TFesLQ,4530
15
+ hirundo-0.1.6.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
16
+ hirundo-0.1.6.dist-info/entry_points.txt,sha256=4ZtnA_Nl1Af8fLnHp3lwjbGDEGU1S6ujb_JwtuQ7ZPM,44
17
+ hirundo-0.1.6.dist-info/top_level.txt,sha256=cmyNqrNZOAYxnywJGFI1AJBLe4SkH8HGsfFx6ncdrbI,8
18
+ hirundo-0.1.6.dist-info/RECORD,,