nextmv 0.27.0__py3-none-any.whl → 0.28.1__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.
nextmv/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "v0.27.0"
1
+ __version__ = "v0.28.1"
nextmv/__init__.py CHANGED
@@ -1,6 +1,7 @@
1
1
  """Nextmv Python SDK."""
2
2
 
3
3
  from .__about__ import __version__
4
+ from .base_model import BaseModel as BaseModel
4
5
  from .base_model import from_dict as from_dict
5
6
  from .input import Input as Input
6
7
  from .input import InputFormat as InputFormat
nextmv/base_model.py CHANGED
@@ -1,17 +1,52 @@
1
- """JSON class for data wrangling JSON objects."""
1
+ """
2
+ Provides base functionality for handling JSON data in models.
3
+
4
+ This module contains utilities for converting between dictionaries and model
5
+ instances, facilitating data serialization and deserialization.
6
+
7
+ Classes
8
+ -------
9
+ BaseModel:
10
+ A base class extending Pydantic's BaseModel with additional methods for
11
+ JSON data serialization and deserialization.
12
+
13
+ Functions
14
+ ---------
15
+ from_dict:
16
+ Load a data model instance from a dictionary containing class information
17
+ and attributes.
18
+ """
2
19
 
3
20
  from importlib import import_module
4
21
  from typing import Any, Optional
5
22
 
6
- from pydantic import BaseModel
23
+ from pydantic import BaseModel as PydanticBaseModel
7
24
 
8
25
 
9
- class BaseModel(BaseModel):
10
- """Base class for data wrangling tasks with JSON."""
26
+ class BaseModel(PydanticBaseModel):
27
+ """
28
+ Base class for data wrangling tasks with JSON.
29
+
30
+ This class extends Pydantic's `BaseModel` to provide additional methods
31
+ for converting between Python objects and JSON/dictionary representations.
32
+ """
11
33
 
12
34
  @classmethod
13
35
  def from_dict(cls, data: Optional[dict[str, Any]] = None):
14
- """Instantiates the class from a dict."""
36
+ """
37
+ Instantiate the class from a dictionary.
38
+
39
+ Parameters
40
+ ----------
41
+ data : dict[str, Any], optional
42
+ The dictionary containing the data to instantiate the class.
43
+ If None, returns None.
44
+
45
+ Returns
46
+ -------
47
+ cls or None
48
+ An instance of the class with the given data or None if data is None.
49
+ """
15
50
 
16
51
  if data is None:
17
52
  return None
@@ -19,14 +54,24 @@ class BaseModel(BaseModel):
19
54
  return cls(**data)
20
55
 
21
56
  def to_dict(self) -> dict[str, Any]:
22
- """Converts the class to a dict."""
57
+ """
58
+ Convert the class instance to a dictionary.
59
+
60
+ The conversion uses Pydantic's model_dump method, excluding None values
61
+ and using field aliases if defined.
62
+
63
+ Returns
64
+ -------
65
+ dict[str, Any]
66
+ Dictionary representation of the class instance.
67
+ """
23
68
 
24
69
  return self.model_dump(mode="json", exclude_none=True, by_alias=True)
25
70
 
26
71
 
27
72
  def from_dict(data: dict[str, Any]) -> Any:
28
73
  """
29
- Load a data model instance from a dict with associated class info.
74
+ Load a data model instance from a `dict` with associated class info.
30
75
 
31
76
  Parameters
32
77
  ----------
nextmv/cloud/__init__.py CHANGED
@@ -23,15 +23,18 @@ from .application import Application as Application
23
23
  from .application import DownloadURL as DownloadURL
24
24
  from .application import PollingOptions as PollingOptions
25
25
  from .application import UploadURL as UploadURL
26
+ from .application import poll as poll
26
27
  from .batch_experiment import BatchExperiment as BatchExperiment
27
28
  from .batch_experiment import BatchExperimentInformation as BatchExperimentInformation
28
29
  from .batch_experiment import BatchExperimentMetadata as BatchExperimentMetadata
29
30
  from .batch_experiment import BatchExperimentRun as BatchExperimentRun
30
31
  from .client import Client as Client
32
+ from .client import get_size as get_size
31
33
  from .input_set import InputSet as InputSet
32
34
  from .input_set import ManagedInput as ManagedInput
33
35
  from .instance import Instance as Instance
34
36
  from .instance import InstanceConfiguration as InstanceConfiguration
37
+ from .manifest import MANIFEST_FILE_NAME as MANIFEST_FILE_NAME
35
38
  from .manifest import Manifest as Manifest
36
39
  from .manifest import ManifestBuild as ManifestBuild
37
40
  from .manifest import ManifestOption as ManifestOption