ml-dash 0.0.11__py3-none-any.whl → 0.5.9__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.
- ml_dash/__init__.py +59 -1
- ml_dash/auto_start.py +42 -0
- ml_dash/cli.py +67 -0
- ml_dash/cli_commands/__init__.py +1 -0
- ml_dash/cli_commands/download.py +797 -0
- ml_dash/cli_commands/list.py +343 -0
- ml_dash/cli_commands/upload.py +1298 -0
- ml_dash/client.py +955 -0
- ml_dash/config.py +114 -11
- ml_dash/experiment.py +1020 -0
- ml_dash/files.py +688 -0
- ml_dash/log.py +181 -0
- ml_dash/metric.py +292 -0
- ml_dash/params.py +188 -0
- ml_dash/storage.py +1115 -0
- ml_dash-0.5.9.dist-info/METADATA +244 -0
- ml_dash-0.5.9.dist-info/RECORD +20 -0
- ml_dash-0.5.9.dist-info/WHEEL +4 -0
- ml_dash-0.5.9.dist-info/entry_points.txt +3 -0
- ml_dash/app.py +0 -33
- ml_dash/file_events.py +0 -71
- ml_dash/file_handlers.py +0 -141
- ml_dash/file_utils.py +0 -5
- ml_dash/file_watcher.py +0 -30
- ml_dash/main.py +0 -60
- ml_dash/mime_types.py +0 -20
- ml_dash/schema/__init__.py +0 -110
- ml_dash/schema/archive.py +0 -165
- ml_dash/schema/directories.py +0 -59
- ml_dash/schema/experiments.py +0 -65
- ml_dash/schema/files/__init__.py +0 -204
- ml_dash/schema/files/file_helpers.py +0 -79
- ml_dash/schema/files/images.py +0 -27
- ml_dash/schema/files/metrics.py +0 -64
- ml_dash/schema/files/parameters.py +0 -50
- ml_dash/schema/files/series.py +0 -235
- ml_dash/schema/files/videos.py +0 -27
- ml_dash/schema/helpers.py +0 -66
- ml_dash/schema/projects.py +0 -65
- ml_dash/schema/schema_helpers.py +0 -19
- ml_dash/schema/users.py +0 -33
- ml_dash/sse.py +0 -18
- ml_dash-0.0.11.dist-info/METADATA +0 -67
- ml_dash-0.0.11.dist-info/RECORD +0 -30
- ml_dash-0.0.11.dist-info/WHEEL +0 -5
- ml_dash-0.0.11.dist-info/top_level.txt +0 -1
- /ml_dash/{example.py → py.typed} +0 -0
ml_dash/__init__.py
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"""
|
|
2
|
+
ML-Dash Python SDK
|
|
3
|
+
|
|
4
|
+
A simple and flexible SDK for ML experiment metricing and data storage.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
|
|
8
|
+
# Remote mode (API server)
|
|
9
|
+
from ml_dash import Experiment
|
|
10
|
+
|
|
11
|
+
with Experiment(
|
|
12
|
+
name="my-experiment",
|
|
13
|
+
project="my-project",
|
|
14
|
+
remote="http://localhost:3000",
|
|
15
|
+
api_key="your-jwt-token"
|
|
16
|
+
) as experiment:
|
|
17
|
+
experiment.log("Training started")
|
|
18
|
+
experiment.metric("loss", {"step": 0, "value": 0.5})
|
|
19
|
+
|
|
20
|
+
# Local mode (filesystem)
|
|
21
|
+
with Experiment(
|
|
22
|
+
name="my-experiment",
|
|
23
|
+
project="my-project",
|
|
24
|
+
local_path=".ml-dash"
|
|
25
|
+
) as experiment:
|
|
26
|
+
experiment.log("Training started")
|
|
27
|
+
|
|
28
|
+
# Decorator style
|
|
29
|
+
from ml_dash import ml_dash_experiment
|
|
30
|
+
|
|
31
|
+
@ml_dash_experiment(
|
|
32
|
+
name="my-experiment",
|
|
33
|
+
project="my-project",
|
|
34
|
+
remote="http://localhost:3000",
|
|
35
|
+
api_key="your-jwt-token"
|
|
36
|
+
)
|
|
37
|
+
def train_model(experiment):
|
|
38
|
+
experiment.log("Training started")
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
from .experiment import Experiment, ml_dash_experiment, OperationMode, RunManager
|
|
42
|
+
from .client import RemoteClient
|
|
43
|
+
from .storage import LocalStorage
|
|
44
|
+
from .log import LogLevel, LogBuilder
|
|
45
|
+
from .params import ParametersBuilder
|
|
46
|
+
|
|
47
|
+
__version__ = "0.1.0"
|
|
48
|
+
|
|
49
|
+
__all__ = [
|
|
50
|
+
"Experiment",
|
|
51
|
+
"ml_dash_experiment",
|
|
52
|
+
"OperationMode",
|
|
53
|
+
"RunManager",
|
|
54
|
+
"RemoteClient",
|
|
55
|
+
"LocalStorage",
|
|
56
|
+
"LogLevel",
|
|
57
|
+
"LogBuilder",
|
|
58
|
+
"ParametersBuilder",
|
|
59
|
+
]
|
ml_dash/auto_start.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Auto-start module for ML-Dash SDK.
|
|
3
|
+
|
|
4
|
+
Provides a pre-configured, auto-started experiment singleton named 'dxp'.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
from ml_dash.auto_start import dxp
|
|
8
|
+
|
|
9
|
+
# Ready to use immediately - no need to open/start
|
|
10
|
+
dxp.log("Hello from dxp!")
|
|
11
|
+
dxp.params.set(lr=0.001)
|
|
12
|
+
dxp.metrics("loss").append(step=0, value=0.5)
|
|
13
|
+
|
|
14
|
+
# Automatically closed on Python exit
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import atexit
|
|
18
|
+
from .experiment import Experiment
|
|
19
|
+
|
|
20
|
+
# Create pre-configured singleton experiment
|
|
21
|
+
dxp = Experiment(
|
|
22
|
+
name="dxp",
|
|
23
|
+
project="scratch",
|
|
24
|
+
local_path=".ml-dash"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Auto-start the experiment on import
|
|
28
|
+
dxp.run.start()
|
|
29
|
+
|
|
30
|
+
# Register cleanup handler to complete experiment on Python exit
|
|
31
|
+
def _cleanup():
|
|
32
|
+
"""Complete the dxp experiment on exit if still open."""
|
|
33
|
+
if dxp._is_open:
|
|
34
|
+
try:
|
|
35
|
+
dxp.run.complete()
|
|
36
|
+
except Exception:
|
|
37
|
+
# Silently ignore errors during cleanup
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
atexit.register(_cleanup)
|
|
41
|
+
|
|
42
|
+
__all__ = ["dxp"]
|
ml_dash/cli.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""ML-Dash command-line interface."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def create_parser() -> argparse.ArgumentParser:
|
|
9
|
+
"""Create the main CLI argument parser."""
|
|
10
|
+
parser = argparse.ArgumentParser(
|
|
11
|
+
prog="ml-dash",
|
|
12
|
+
description="ML-Dash: ML experiment tracking and data storage CLI",
|
|
13
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
# Add subcommands
|
|
17
|
+
subparsers = parser.add_subparsers(
|
|
18
|
+
dest="command",
|
|
19
|
+
help="Available commands",
|
|
20
|
+
metavar="COMMAND",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Import and add command parsers
|
|
24
|
+
from .cli_commands import upload, download, list as list_cmd
|
|
25
|
+
upload.add_parser(subparsers)
|
|
26
|
+
download.add_parser(subparsers)
|
|
27
|
+
list_cmd.add_parser(subparsers)
|
|
28
|
+
|
|
29
|
+
return parser
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def main(argv: Optional[List[str]] = None) -> int:
|
|
33
|
+
"""
|
|
34
|
+
Main CLI entry point.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
argv: Command-line arguments (defaults to sys.argv[1:])
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Exit code (0 for success, non-zero for error)
|
|
41
|
+
"""
|
|
42
|
+
parser = create_parser()
|
|
43
|
+
args = parser.parse_args(argv)
|
|
44
|
+
|
|
45
|
+
# If no command specified, show help
|
|
46
|
+
if args.command is None:
|
|
47
|
+
parser.print_help()
|
|
48
|
+
return 0
|
|
49
|
+
|
|
50
|
+
# Route to command handlers
|
|
51
|
+
if args.command == "upload":
|
|
52
|
+
from .cli_commands import upload
|
|
53
|
+
return upload.cmd_upload(args)
|
|
54
|
+
elif args.command == "download":
|
|
55
|
+
from .cli_commands import download
|
|
56
|
+
return download.cmd_download(args)
|
|
57
|
+
elif args.command == "list":
|
|
58
|
+
from .cli_commands import list as list_cmd
|
|
59
|
+
return list_cmd.cmd_list(args)
|
|
60
|
+
|
|
61
|
+
# Unknown command (shouldn't happen due to subparsers)
|
|
62
|
+
parser.print_help()
|
|
63
|
+
return 1
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
if __name__ == "__main__":
|
|
67
|
+
sys.exit(main())
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""CLI command modules for ML-Dash."""
|