doushi-cli 1.0.2__tar.gz → 1.0.4__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 (26) hide show
  1. {doushi_cli-1.0.2/doushi_cli.egg-info → doushi_cli-1.0.4}/PKG-INFO +1 -1
  2. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/__init__.py +1 -1
  3. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/client.py +29 -0
  4. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/export.py +8 -0
  5. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/templates.py +2 -0
  6. {doushi_cli-1.0.2 → doushi_cli-1.0.4/doushi_cli.egg-info}/PKG-INFO +1 -1
  7. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/pyproject.toml +1 -1
  8. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/tests/test_cli.py +2 -1
  9. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/LICENSE +0 -0
  10. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/README.md +0 -0
  11. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/__init__.py +0 -0
  12. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/auth.py +0 -0
  13. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/demo.py +0 -0
  14. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/logs.py +0 -0
  15. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/predict.py +0 -0
  16. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/projects.py +0 -0
  17. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/commands/train.py +0 -0
  18. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/config.py +0 -0
  19. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/main.py +0 -0
  20. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi/ui.py +0 -0
  21. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi_cli.egg-info/SOURCES.txt +0 -0
  22. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi_cli.egg-info/dependency_links.txt +0 -0
  23. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi_cli.egg-info/entry_points.txt +0 -0
  24. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi_cli.egg-info/requires.txt +0 -0
  25. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/doushi_cli.egg-info/top_level.txt +0 -0
  26. {doushi_cli-1.0.2 → doushi_cli-1.0.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: doushi-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Official CLI for Doushi.ai - Instant Autonomous ML Modeling from your Terminal
5
5
  Author-email: Doushi AI Team <support@doushi.ai>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
1
  """Doushi CLI - Instant Autonomous ML Modeling from your Terminal."""
2
2
 
3
- __version__ = "1.0.2"
3
+ __version__ = "1.0.4"
4
4
  __app_name__ = "doushi"
@@ -253,3 +253,32 @@ class DoushiClient:
253
253
  headers=self._get_headers()
254
254
  )
255
255
  return self._handle_response(resp)
256
+
257
+ def download_model_artifact(self, project_id: str, dest_file: Path) -> bool:
258
+ """Download trained model.pkl artifact to destination file."""
259
+ self.check_auth_or_exit()
260
+ try:
261
+ with httpx.Client(timeout=self.timeout) as client:
262
+ resp = client.get(f"{self.base_url}/api/projects/{project_id}/download-model", headers=self._get_headers())
263
+ data = self._handle_response(resp)
264
+ presigned_url = data.get("url")
265
+ except Exception:
266
+ return False
267
+
268
+ if not presigned_url:
269
+ return False
270
+
271
+ try:
272
+ with httpx.Client(timeout=180.0, follow_redirects=True) as client:
273
+ with client.stream("GET", presigned_url) as stream_resp:
274
+ if stream_resp.status_code == 404:
275
+ return False
276
+ if not stream_resp.is_success:
277
+ return False
278
+ with open(dest_file, "wb") as f:
279
+ for chunk in stream_resp.iter_bytes(chunk_size=65536):
280
+ f.write(chunk)
281
+ return dest_file.exists() and dest_file.stat().st_size > 0
282
+ except Exception:
283
+ return False
284
+
@@ -66,9 +66,17 @@ def export_model(
66
66
  with open(out_dir / "README.md", "w", encoding="utf-8") as f:
67
67
  f.write(generate_export_readme(project_id=project_id, project_name=project_name))
68
68
 
69
+ # 4. Download trained model.pkl artifact
70
+ model_file = out_dir / "model.pkl"
71
+ has_model_file = False
72
+ with console.status(f"[bold cyan]Downloading model artifact (model.pkl)...[/bold cyan]"):
73
+ has_model_file = client.download_model_artifact(project_id=project_id, dest_file=model_file)
74
+
69
75
  console.print("\n")
70
76
  print_success(f"Project exported successfully to [bold cyan]{out_dir}[/bold cyan]!")
71
77
  console.print("\n[dim]Files created:[/dim]")
78
+ if has_model_file:
79
+ console.print(f" ├── [bold green]{out_dir}/model.pkl[/bold green] (trained model weights)")
72
80
  console.print(f" ├── {out_dir}/pipeline.py")
73
81
  console.print(f" ├── {out_dir}/serve.py")
74
82
  console.print(f" ├── {out_dir}/Dockerfile")
@@ -77,6 +77,8 @@ pandas>=2.0.0
77
77
  numpy>=1.24.0
78
78
  scikit-learn>=1.4.0
79
79
  xgboost>=2.0.0
80
+ lightgbm>=4.0.0
81
+ catboost>=1.2.0
80
82
  joblib>=1.3.0
81
83
  '''
82
84
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: doushi-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Official CLI for Doushi.ai - Instant Autonomous ML Modeling from your Terminal
5
5
  Author-email: Doushi AI Team <support@doushi.ai>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "doushi-cli"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "Official CLI for Doushi.ai - Instant Autonomous ML Modeling from your Terminal"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -39,9 +39,10 @@ class TestDoushiCLI(unittest.TestCase):
39
39
 
40
40
  def test_version_output(self):
41
41
  """Verify --version flag outputs version."""
42
+ from doushi import __version__
42
43
  result = self.runner.invoke(app, ["--version"])
43
44
  self.assertEqual(result.exit_code, 0)
44
- self.assertIn("1.0.2", result.output)
45
+ self.assertIn(__version__, result.output)
45
46
 
46
47
  def test_subcommand_helps(self):
47
48
  """Verify subcommands provide descriptive help."""
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes