mtbpy 1.0.1__tar.gz → 2.0.0__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.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Minitab, LLC
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2023 Minitab, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,44 +1,46 @@
1
- Metadata-Version: 2.1
2
- Name: mtbpy
3
- Version: 1.0.1
4
- Summary: Module for communicating with Minitab from Python scripts executed via the PYSC command.
5
- Author-email: "Minitab, LLC" <techsupport@minitab.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2020 Minitab, LLC
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://support.minitab.com/minitab/
29
- Classifier: Development Status :: 5 - Production/Stable
30
- Classifier: Intended Audience :: Developers
31
- Classifier: Intended Audience :: End Users/Desktop
32
- Classifier: Topic :: Scientific/Engineering
33
- Classifier: License :: OSI Approved :: MIT License
34
- Classifier: Programming Language :: Python :: 3 :: Only
35
- Classifier: Operating System :: OS Independent
36
- Requires-Python: >=3.7
37
- Description-Content-Type: text/markdown
38
- Provides-Extra: dev
39
- License-File: LICENSE.txt
40
-
41
- # mtbpy
42
-
43
- The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
44
- scripts to communicate with Minitab Statistical Software when executed via MSS's `PYSC` command.
1
+ Metadata-Version: 2.4
2
+ Name: mtbpy
3
+ Version: 2.0.0
4
+ Summary: Module for communicating with Minitab from Python scripts executed via the PYSC command.
5
+ Author-email: "Minitab, LLC" <techsupport@minitab.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2020-2023 Minitab, LLC
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://support.minitab.com/minitab/
29
+ Classifier: Development Status :: 5 - Production/Stable
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: Intended Audience :: End Users/Desktop
32
+ Classifier: Topic :: Scientific/Engineering
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3 :: Only
35
+ Classifier: Operating System :: OS Independent
36
+ Requires-Python: >=3.10
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE.txt
39
+ Requires-Dist: protobuf>=7.35.1
40
+ Requires-Dist: grpcio>=1.84.0
41
+ Dynamic: license-file
42
+
43
+ # mtbpy
44
+
45
+ The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
46
+ scripts to communicate with Minitab Statistical Software when executed via MSS's `PYSC` command.
@@ -1,4 +1,4 @@
1
- # mtbpy
2
-
3
- The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
1
+ # mtbpy
2
+
3
+ The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
4
4
  scripts to communicate with Minitab Statistical Software when executed via MSS's `PYSC` command.
@@ -1,11 +1,22 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
3
4
  # source: mtbpy/mtb_command_rpc.proto
5
+ # Protobuf Python Version: 7.35.1
4
6
  """Generated protocol buffer code."""
5
- from google.protobuf.internal import builder as _builder
6
7
  from google.protobuf import descriptor as _descriptor
7
8
  from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
8
10
  from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 7,
15
+ 35,
16
+ 1,
17
+ '',
18
+ 'mtbpy/mtb_command_rpc.proto'
19
+ )
9
20
  # @@protoc_insertion_point(imports)
10
21
 
11
22
  _sym_db = _symbol_database.Default()
@@ -16,33 +27,33 @@ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
16
27
 
17
28
  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bmtbpy/mtb_command_rpc.proto\x12\x12rpc.mtb_command.v1\x1a\x1bgoogle/protobuf/empty.proto\"$\n\x11\x41\x64\x64MessageRequest\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\"(\n\x15SetCommandNoteRequest\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\")\n\x16SetCommandTitleRequest\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\"%\n\x0f\x41\x64\x64ImageRequest\x12\x12\n\nimage_data\x18\x01 \x01(\x0c\"\x1b\n\x0bNumericData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x01\"\x18\n\x08TextData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\t\"\x7f\n\x04\x44\x61ta\x12\x37\n\x0cnumeric_data\x18\x01 \x01(\x0b\x32\x1f.rpc.mtb_command.v1.NumericDataH\x00\x12\x31\n\ttext_data\x18\x02 \x01(\x0b\x32\x1c.rpc.mtb_command.v1.TextDataH\x00\x42\x0b\n\tdata_type\"n\n\x0f\x41\x64\x64TableRequest\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08\x66ootnote\x18\x02 \x01(\t\x12)\n\x07\x63olumns\x18\x03 \x03(\x0b\x32\x18.rpc.mtb_command.v1.Data\x12\x0f\n\x07headers\x18\x04 \x03(\t\"U\n\x0fVariableRequest\x12\x32\n\x08var_type\x18\x01 \x01(\x0e\x32 .rpc.mtb_command.v1.VariableType\x12\x0e\n\x06var_id\x18\x02 \x01(\t\"`\n\x10VariableResponse\x12\r\n\x05\x66ound\x18\x01 \x01(\x08\x12\t\n\x01m\x18\x02 \x01(\x05\x12\t\n\x01n\x18\x03 \x01(\x05\x12\x14\n\x0cnumeric_data\x18\x04 \x03(\x01\x12\x11\n\ttext_data\x18\x05 \x03(\t*U\n\x0cVariableType\x12\x13\n\x0fVAR_UNSPECIFIED\x10\x00\x12\x0e\n\nVAR_COLUMN\x10\x01\x12\x10\n\x0cVAR_CONSTANT\x10\x02\x12\x0e\n\nVAR_MATRIX\x10\x03\x32\xf1\x03\n\nMtbCommand\x12K\n\nAddMessage\x12%.rpc.mtb_command.v1.AddMessageRequest\x1a\x16.google.protobuf.Empty\x12S\n\x0eSetCommandNote\x12).rpc.mtb_command.v1.SetCommandNoteRequest\x1a\x16.google.protobuf.Empty\x12U\n\x0fSetCommandTitle\x12*.rpc.mtb_command.v1.SetCommandTitleRequest\x1a\x16.google.protobuf.Empty\x12G\n\x08\x41\x64\x64Image\x12#.rpc.mtb_command.v1.AddImageRequest\x1a\x16.google.protobuf.Empty\x12G\n\x08\x41\x64\x64Table\x12#.rpc.mtb_command.v1.AddTableRequest\x1a\x16.google.protobuf.Empty\x12X\n\x0bGetVariable\x12#.rpc.mtb_command.v1.VariableRequest\x1a$.rpc.mtb_command.v1.VariableResponseb\x06proto3')
18
29
 
19
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mtbpy.mtb_command_rpc_pb2', globals())
21
- if _descriptor._USE_C_DESCRIPTORS == False:
22
-
23
- DESCRIPTOR._options = None
24
- _VARIABLETYPE._serialized_start=723
25
- _VARIABLETYPE._serialized_end=808
26
- _ADDMESSAGEREQUEST._serialized_start=80
27
- _ADDMESSAGEREQUEST._serialized_end=116
28
- _SETCOMMANDNOTEREQUEST._serialized_start=118
29
- _SETCOMMANDNOTEREQUEST._serialized_end=158
30
- _SETCOMMANDTITLEREQUEST._serialized_start=160
31
- _SETCOMMANDTITLEREQUEST._serialized_end=201
32
- _ADDIMAGEREQUEST._serialized_start=203
33
- _ADDIMAGEREQUEST._serialized_end=240
34
- _NUMERICDATA._serialized_start=242
35
- _NUMERICDATA._serialized_end=269
36
- _TEXTDATA._serialized_start=271
37
- _TEXTDATA._serialized_end=295
38
- _DATA._serialized_start=297
39
- _DATA._serialized_end=424
40
- _ADDTABLEREQUEST._serialized_start=426
41
- _ADDTABLEREQUEST._serialized_end=536
42
- _VARIABLEREQUEST._serialized_start=538
43
- _VARIABLEREQUEST._serialized_end=623
44
- _VARIABLERESPONSE._serialized_start=625
45
- _VARIABLERESPONSE._serialized_end=721
46
- _MTBCOMMAND._serialized_start=811
47
- _MTBCOMMAND._serialized_end=1308
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'mtbpy.mtb_command_rpc_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ DESCRIPTOR._loaded_options = None
35
+ _globals['_VARIABLETYPE']._serialized_start=723
36
+ _globals['_VARIABLETYPE']._serialized_end=808
37
+ _globals['_ADDMESSAGEREQUEST']._serialized_start=80
38
+ _globals['_ADDMESSAGEREQUEST']._serialized_end=116
39
+ _globals['_SETCOMMANDNOTEREQUEST']._serialized_start=118
40
+ _globals['_SETCOMMANDNOTEREQUEST']._serialized_end=158
41
+ _globals['_SETCOMMANDTITLEREQUEST']._serialized_start=160
42
+ _globals['_SETCOMMANDTITLEREQUEST']._serialized_end=201
43
+ _globals['_ADDIMAGEREQUEST']._serialized_start=203
44
+ _globals['_ADDIMAGEREQUEST']._serialized_end=240
45
+ _globals['_NUMERICDATA']._serialized_start=242
46
+ _globals['_NUMERICDATA']._serialized_end=269
47
+ _globals['_TEXTDATA']._serialized_start=271
48
+ _globals['_TEXTDATA']._serialized_end=295
49
+ _globals['_DATA']._serialized_start=297
50
+ _globals['_DATA']._serialized_end=424
51
+ _globals['_ADDTABLEREQUEST']._serialized_start=426
52
+ _globals['_ADDTABLEREQUEST']._serialized_end=536
53
+ _globals['_VARIABLEREQUEST']._serialized_start=538
54
+ _globals['_VARIABLEREQUEST']._serialized_end=623
55
+ _globals['_VARIABLERESPONSE']._serialized_start=625
56
+ _globals['_VARIABLERESPONSE']._serialized_end=721
57
+ _globals['_MTBCOMMAND']._serialized_start=811
58
+ _globals['_MTBCOMMAND']._serialized_end=1308
48
59
  # @@protoc_insertion_point(module_scope)
@@ -1,12 +1,32 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
2
  """Client and server classes corresponding to protobuf-defined services."""
3
3
  import grpc
4
+ import warnings
4
5
 
5
6
  from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
6
7
  from mtbpy import mtb_command_rpc_pb2 as mtbpy_dot_mtb__command__rpc__pb2
7
8
 
9
+ GRPC_GENERATED_VERSION = '1.84.0'
10
+ GRPC_VERSION = grpc.__version__
11
+ _version_not_supported = False
8
12
 
9
- class MtbCommandStub(object):
13
+ try:
14
+ from grpc._utilities import first_version_is_lower
15
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
16
+ except ImportError:
17
+ _version_not_supported = True
18
+
19
+ if _version_not_supported:
20
+ raise RuntimeError(
21
+ f'The grpc package installed is at version {GRPC_VERSION},'
22
+ + ' but the generated code in mtbpy/mtb_command_rpc_pb2_grpc.py depends on'
23
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
24
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
25
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
26
+ )
27
+
28
+
29
+ class MtbCommandStub:
10
30
  """Missing associated documentation comment in .proto file."""
11
31
 
12
32
  def __init__(self, channel):
@@ -19,35 +39,35 @@ class MtbCommandStub(object):
19
39
  '/rpc.mtb_command.v1.MtbCommand/AddMessage',
20
40
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.AddMessageRequest.SerializeToString,
21
41
  response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
22
- )
42
+ _registered_method=True)
23
43
  self.SetCommandNote = channel.unary_unary(
24
44
  '/rpc.mtb_command.v1.MtbCommand/SetCommandNote',
25
45
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.SetCommandNoteRequest.SerializeToString,
26
46
  response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
27
- )
47
+ _registered_method=True)
28
48
  self.SetCommandTitle = channel.unary_unary(
29
49
  '/rpc.mtb_command.v1.MtbCommand/SetCommandTitle',
30
50
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.SetCommandTitleRequest.SerializeToString,
31
51
  response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
32
- )
52
+ _registered_method=True)
33
53
  self.AddImage = channel.unary_unary(
34
54
  '/rpc.mtb_command.v1.MtbCommand/AddImage',
35
55
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.AddImageRequest.SerializeToString,
36
56
  response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
37
- )
57
+ _registered_method=True)
38
58
  self.AddTable = channel.unary_unary(
39
59
  '/rpc.mtb_command.v1.MtbCommand/AddTable',
40
60
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.AddTableRequest.SerializeToString,
41
61
  response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
42
- )
62
+ _registered_method=True)
43
63
  self.GetVariable = channel.unary_unary(
44
64
  '/rpc.mtb_command.v1.MtbCommand/GetVariable',
45
65
  request_serializer=mtbpy_dot_mtb__command__rpc__pb2.VariableRequest.SerializeToString,
46
66
  response_deserializer=mtbpy_dot_mtb__command__rpc__pb2.VariableResponse.FromString,
47
- )
67
+ _registered_method=True)
48
68
 
49
69
 
50
- class MtbCommandServicer(object):
70
+ class MtbCommandServicer:
51
71
  """Missing associated documentation comment in .proto file."""
52
72
 
53
73
  def AddMessage(self, request, context):
@@ -123,10 +143,11 @@ def add_MtbCommandServicer_to_server(servicer, server):
123
143
  generic_handler = grpc.method_handlers_generic_handler(
124
144
  'rpc.mtb_command.v1.MtbCommand', rpc_method_handlers)
125
145
  server.add_generic_rpc_handlers((generic_handler,))
146
+ server.add_registered_method_handlers('rpc.mtb_command.v1.MtbCommand', rpc_method_handlers)
126
147
 
127
148
 
128
149
  # This class is part of an EXPERIMENTAL API.
129
- class MtbCommand(object):
150
+ class MtbCommand:
130
151
  """Missing associated documentation comment in .proto file."""
131
152
 
132
153
  @staticmethod
@@ -140,11 +161,21 @@ class MtbCommand(object):
140
161
  wait_for_ready=None,
141
162
  timeout=None,
142
163
  metadata=None):
143
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/AddMessage',
164
+ return grpc.experimental.unary_unary(
165
+ request,
166
+ target,
167
+ '/rpc.mtb_command.v1.MtbCommand/AddMessage',
144
168
  mtbpy_dot_mtb__command__rpc__pb2.AddMessageRequest.SerializeToString,
145
169
  google_dot_protobuf_dot_empty__pb2.Empty.FromString,
146
- options, channel_credentials,
147
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
170
+ options,
171
+ channel_credentials,
172
+ insecure,
173
+ call_credentials,
174
+ compression,
175
+ wait_for_ready,
176
+ timeout,
177
+ metadata,
178
+ _registered_method=True)
148
179
 
149
180
  @staticmethod
150
181
  def SetCommandNote(request,
@@ -157,11 +188,21 @@ class MtbCommand(object):
157
188
  wait_for_ready=None,
158
189
  timeout=None,
159
190
  metadata=None):
160
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/SetCommandNote',
191
+ return grpc.experimental.unary_unary(
192
+ request,
193
+ target,
194
+ '/rpc.mtb_command.v1.MtbCommand/SetCommandNote',
161
195
  mtbpy_dot_mtb__command__rpc__pb2.SetCommandNoteRequest.SerializeToString,
162
196
  google_dot_protobuf_dot_empty__pb2.Empty.FromString,
163
- options, channel_credentials,
164
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
197
+ options,
198
+ channel_credentials,
199
+ insecure,
200
+ call_credentials,
201
+ compression,
202
+ wait_for_ready,
203
+ timeout,
204
+ metadata,
205
+ _registered_method=True)
165
206
 
166
207
  @staticmethod
167
208
  def SetCommandTitle(request,
@@ -174,11 +215,21 @@ class MtbCommand(object):
174
215
  wait_for_ready=None,
175
216
  timeout=None,
176
217
  metadata=None):
177
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/SetCommandTitle',
218
+ return grpc.experimental.unary_unary(
219
+ request,
220
+ target,
221
+ '/rpc.mtb_command.v1.MtbCommand/SetCommandTitle',
178
222
  mtbpy_dot_mtb__command__rpc__pb2.SetCommandTitleRequest.SerializeToString,
179
223
  google_dot_protobuf_dot_empty__pb2.Empty.FromString,
180
- options, channel_credentials,
181
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
224
+ options,
225
+ channel_credentials,
226
+ insecure,
227
+ call_credentials,
228
+ compression,
229
+ wait_for_ready,
230
+ timeout,
231
+ metadata,
232
+ _registered_method=True)
182
233
 
183
234
  @staticmethod
184
235
  def AddImage(request,
@@ -191,11 +242,21 @@ class MtbCommand(object):
191
242
  wait_for_ready=None,
192
243
  timeout=None,
193
244
  metadata=None):
194
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/AddImage',
245
+ return grpc.experimental.unary_unary(
246
+ request,
247
+ target,
248
+ '/rpc.mtb_command.v1.MtbCommand/AddImage',
195
249
  mtbpy_dot_mtb__command__rpc__pb2.AddImageRequest.SerializeToString,
196
250
  google_dot_protobuf_dot_empty__pb2.Empty.FromString,
197
- options, channel_credentials,
198
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
251
+ options,
252
+ channel_credentials,
253
+ insecure,
254
+ call_credentials,
255
+ compression,
256
+ wait_for_ready,
257
+ timeout,
258
+ metadata,
259
+ _registered_method=True)
199
260
 
200
261
  @staticmethod
201
262
  def AddTable(request,
@@ -208,11 +269,21 @@ class MtbCommand(object):
208
269
  wait_for_ready=None,
209
270
  timeout=None,
210
271
  metadata=None):
211
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/AddTable',
272
+ return grpc.experimental.unary_unary(
273
+ request,
274
+ target,
275
+ '/rpc.mtb_command.v1.MtbCommand/AddTable',
212
276
  mtbpy_dot_mtb__command__rpc__pb2.AddTableRequest.SerializeToString,
213
277
  google_dot_protobuf_dot_empty__pb2.Empty.FromString,
214
- options, channel_credentials,
215
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
278
+ options,
279
+ channel_credentials,
280
+ insecure,
281
+ call_credentials,
282
+ compression,
283
+ wait_for_ready,
284
+ timeout,
285
+ metadata,
286
+ _registered_method=True)
216
287
 
217
288
  @staticmethod
218
289
  def GetVariable(request,
@@ -225,8 +296,18 @@ class MtbCommand(object):
225
296
  wait_for_ready=None,
226
297
  timeout=None,
227
298
  metadata=None):
228
- return grpc.experimental.unary_unary(request, target, '/rpc.mtb_command.v1.MtbCommand/GetVariable',
299
+ return grpc.experimental.unary_unary(
300
+ request,
301
+ target,
302
+ '/rpc.mtb_command.v1.MtbCommand/GetVariable',
229
303
  mtbpy_dot_mtb__command__rpc__pb2.VariableRequest.SerializeToString,
230
304
  mtbpy_dot_mtb__command__rpc__pb2.VariableResponse.FromString,
231
- options, channel_credentials,
232
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
305
+ options,
306
+ channel_credentials,
307
+ insecure,
308
+ call_credentials,
309
+ compression,
310
+ wait_for_ready,
311
+ timeout,
312
+ metadata,
313
+ _registered_method=True)
@@ -1,130 +1,130 @@
1
- import os
2
- from itertools import cycle
3
- from numbers import Number
4
-
5
- import grpc
6
- from mtbpy import mtb_command_rpc_pb2
7
- from mtbpy import mtb_command_rpc_pb2_grpc
8
-
9
-
10
- class mtb_instance(object):
11
- def __init__(self):
12
- address = "127.0.0.1:{0}".format(os.getenv("MTB_RPC_PORT"))
13
- self.channel = grpc.insecure_channel(address, options=[
14
- ("grpc.max_receive_message_length", -1)
15
- ])
16
- try:
17
- grpc.channel_ready_future(self.channel).result(timeout=5)
18
- except grpc.FutureTimeoutError:
19
- raise RuntimeError(
20
- "Error connecting to Minitab at {0}".format(address))
21
- self.rpc_stub = mtb_command_rpc_pb2_grpc.MtbCommandStub(self.channel)
22
-
23
- def __enter__(self):
24
- return self
25
-
26
- def __exit__(self, exc_type, exc_value, traceback):
27
- self.channel.close()
28
-
29
- def get_column(self, column_name):
30
- request = mtb_command_rpc_pb2.VariableRequest()
31
- request.var_type = mtb_command_rpc_pb2.VariableType.VAR_COLUMN
32
- request.var_id = column_name
33
- try:
34
- response = self.rpc_stub.GetVariable(request)
35
- except grpc.RpcError as e:
36
- if e.code() != grpc.StatusCode.NOT_FOUND:
37
- raise
38
- else:
39
- if response.found:
40
- if len(response.numeric_data) > 0:
41
- return response.numeric_data
42
- elif len(response.text_data) > 0:
43
- return response.text_data
44
-
45
- def get_constant(self, constant_name):
46
- request = mtb_command_rpc_pb2.VariableRequest()
47
- request.var_type = mtb_command_rpc_pb2.VariableType.VAR_CONSTANT
48
- request.var_id = constant_name
49
- try:
50
- response = self.rpc_stub.GetVariable(request)
51
- except grpc.RpcError as e:
52
- if e.code() != grpc.StatusCode.NOT_FOUND:
53
- raise
54
- else:
55
- if response.found:
56
- if len(response.numeric_data) > 0:
57
- return response.numeric_data[0]
58
- elif len(response.text_data) > 0:
59
- return response.text_data[0]
60
-
61
- def get_matrix(self, matrix_name):
62
- request = mtb_command_rpc_pb2.VariableRequest()
63
- request.var_type = mtb_command_rpc_pb2.VariableType.VAR_MATRIX
64
- request.var_id = matrix_name
65
- try:
66
- response = self.rpc_stub.GetVariable(request)
67
- except grpc.RpcError as e:
68
- if e.code() != grpc.StatusCode.NOT_FOUND:
69
- raise
70
- else:
71
- if response.found and len(response.numeric_data) > 0:
72
- lists = [[] for i in range(response.m)]
73
- for d, m in zip(response.numeric_data, cycle(range(response.m))):
74
- lists[m].append(d)
75
- return lists
76
-
77
- def add_message(self, content):
78
- request = mtb_command_rpc_pb2.AddMessageRequest()
79
- request.content = content
80
- self.rpc_stub.AddMessage(request)
81
-
82
- def set_note(self, content):
83
- request = mtb_command_rpc_pb2.SetCommandNoteRequest()
84
- request.content = content
85
- self.rpc_stub.SetCommandNote(request)
86
-
87
- def set_command_title(self, content):
88
- request = mtb_command_rpc_pb2.SetCommandTitleRequest()
89
- request.content = content
90
- try:
91
- self.rpc_stub.SetCommandTitle(request)
92
- except grpc.RpcError as e:
93
- if e.code() != grpc.StatusCode.INVALID_ARGUMENT:
94
- raise
95
-
96
- def add_image(self, path):
97
- image_data = None
98
- with open(path, "rb") as f:
99
- image_data = f.read()
100
- self.add_image_bytes(image_data)
101
-
102
- def add_image_bytes(self, bytes):
103
- request = mtb_command_rpc_pb2.AddImageRequest()
104
- request.image_data = bytes
105
- self.rpc_stub.AddImage(request)
106
-
107
- def add_table(self, columns, headers=[], title="", footnote=""):
108
- request = mtb_command_rpc_pb2.AddTableRequest()
109
- if isinstance(title, str):
110
- request.title = title
111
- if isinstance(footnote, str):
112
- request.footnote = footnote
113
-
114
- for column in columns:
115
- data = request.columns.add()
116
- if len(column) == 0:
117
- # empty column, but still need to 'set' the oneof
118
- data.numeric_data.data[:] = []
119
- continue
120
- if isinstance(column[0], Number):
121
- data.numeric_data.data[:] = map(float, column)
122
- elif isinstance(column[0], str):
123
- data.text_data.data[:] = map(str, column)
124
- else:
125
- raise TypeError(
126
- "Table data values must be of type str or a subclass of `numbers.Number`.")
127
-
128
- request.headers[:] = map(str, headers)
129
-
130
- self.rpc_stub.AddTable(request)
1
+ import os
2
+ from itertools import cycle
3
+ from numbers import Number
4
+
5
+ import grpc
6
+ from mtbpy import mtb_command_rpc_pb2
7
+ from mtbpy import mtb_command_rpc_pb2_grpc
8
+
9
+
10
+ class mtb_instance(object):
11
+ def __init__(self):
12
+ address = "127.0.0.1:{0}".format(os.getenv("MTB_RPC_PORT"))
13
+ self.channel = grpc.insecure_channel(address, options=[
14
+ ("grpc.max_receive_message_length", -1)
15
+ ])
16
+ try:
17
+ grpc.channel_ready_future(self.channel).result(timeout=5)
18
+ except grpc.FutureTimeoutError:
19
+ raise RuntimeError(
20
+ "Error connecting to Minitab at {0}".format(address))
21
+ self.rpc_stub = mtb_command_rpc_pb2_grpc.MtbCommandStub(self.channel)
22
+
23
+ def __enter__(self):
24
+ return self
25
+
26
+ def __exit__(self, exc_type, exc_value, traceback):
27
+ self.channel.close()
28
+
29
+ def get_column(self, column_name):
30
+ request = mtb_command_rpc_pb2.VariableRequest()
31
+ request.var_type = mtb_command_rpc_pb2.VariableType.VAR_COLUMN
32
+ request.var_id = column_name
33
+ try:
34
+ response = self.rpc_stub.GetVariable(request)
35
+ except grpc.RpcError as e:
36
+ if e.code() != grpc.StatusCode.NOT_FOUND:
37
+ raise
38
+ else:
39
+ if response.found:
40
+ if len(response.numeric_data) > 0:
41
+ return response.numeric_data
42
+ elif len(response.text_data) > 0:
43
+ return response.text_data
44
+
45
+ def get_constant(self, constant_name):
46
+ request = mtb_command_rpc_pb2.VariableRequest()
47
+ request.var_type = mtb_command_rpc_pb2.VariableType.VAR_CONSTANT
48
+ request.var_id = constant_name
49
+ try:
50
+ response = self.rpc_stub.GetVariable(request)
51
+ except grpc.RpcError as e:
52
+ if e.code() != grpc.StatusCode.NOT_FOUND:
53
+ raise
54
+ else:
55
+ if response.found:
56
+ if len(response.numeric_data) > 0:
57
+ return response.numeric_data[0]
58
+ elif len(response.text_data) > 0:
59
+ return response.text_data[0]
60
+
61
+ def get_matrix(self, matrix_name):
62
+ request = mtb_command_rpc_pb2.VariableRequest()
63
+ request.var_type = mtb_command_rpc_pb2.VariableType.VAR_MATRIX
64
+ request.var_id = matrix_name
65
+ try:
66
+ response = self.rpc_stub.GetVariable(request)
67
+ except grpc.RpcError as e:
68
+ if e.code() != grpc.StatusCode.NOT_FOUND:
69
+ raise
70
+ else:
71
+ if response.found and len(response.numeric_data) > 0:
72
+ lists = [[] for i in range(response.m)]
73
+ for d, m in zip(response.numeric_data, cycle(range(response.m))):
74
+ lists[m].append(d)
75
+ return lists
76
+
77
+ def add_message(self, content):
78
+ request = mtb_command_rpc_pb2.AddMessageRequest()
79
+ request.content = content
80
+ self.rpc_stub.AddMessage(request)
81
+
82
+ def set_note(self, content):
83
+ request = mtb_command_rpc_pb2.SetCommandNoteRequest()
84
+ request.content = content
85
+ self.rpc_stub.SetCommandNote(request)
86
+
87
+ def set_command_title(self, content):
88
+ request = mtb_command_rpc_pb2.SetCommandTitleRequest()
89
+ request.content = content
90
+ try:
91
+ self.rpc_stub.SetCommandTitle(request)
92
+ except grpc.RpcError as e:
93
+ if e.code() != grpc.StatusCode.INVALID_ARGUMENT:
94
+ raise
95
+
96
+ def add_image(self, path):
97
+ image_data = None
98
+ with open(path, "rb") as f:
99
+ image_data = f.read()
100
+ self.add_image_bytes(image_data)
101
+
102
+ def add_image_bytes(self, bytes):
103
+ request = mtb_command_rpc_pb2.AddImageRequest()
104
+ request.image_data = bytes
105
+ self.rpc_stub.AddImage(request)
106
+
107
+ def add_table(self, columns, headers=[], title="", footnote=""):
108
+ request = mtb_command_rpc_pb2.AddTableRequest()
109
+ if isinstance(title, str):
110
+ request.title = title
111
+ if isinstance(footnote, str):
112
+ request.footnote = footnote
113
+
114
+ for column in columns:
115
+ data = request.columns.add()
116
+ if len(column) == 0:
117
+ # empty column, but still need to 'set' the oneof
118
+ data.numeric_data.data[:] = []
119
+ continue
120
+ if isinstance(column[0], Number):
121
+ data.numeric_data.data[:] = map(float, column)
122
+ elif isinstance(column[0], str):
123
+ data.text_data.data[:] = map(str, column)
124
+ else:
125
+ raise TypeError(
126
+ "Table data values must be of type str or a subclass of `numbers.Number`.")
127
+
128
+ request.headers[:] = map(str, headers)
129
+
130
+ self.rpc_stub.AddTable(request)
@@ -1,44 +1,46 @@
1
- Metadata-Version: 2.1
2
- Name: mtbpy
3
- Version: 1.0.1
4
- Summary: Module for communicating with Minitab from Python scripts executed via the PYSC command.
5
- Author-email: "Minitab, LLC" <techsupport@minitab.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2020 Minitab, LLC
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://support.minitab.com/minitab/
29
- Classifier: Development Status :: 5 - Production/Stable
30
- Classifier: Intended Audience :: Developers
31
- Classifier: Intended Audience :: End Users/Desktop
32
- Classifier: Topic :: Scientific/Engineering
33
- Classifier: License :: OSI Approved :: MIT License
34
- Classifier: Programming Language :: Python :: 3 :: Only
35
- Classifier: Operating System :: OS Independent
36
- Requires-Python: >=3.7
37
- Description-Content-Type: text/markdown
38
- Provides-Extra: dev
39
- License-File: LICENSE.txt
40
-
41
- # mtbpy
42
-
43
- The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
44
- scripts to communicate with Minitab Statistical Software when executed via MSS's `PYSC` command.
1
+ Metadata-Version: 2.4
2
+ Name: mtbpy
3
+ Version: 2.0.0
4
+ Summary: Module for communicating with Minitab from Python scripts executed via the PYSC command.
5
+ Author-email: "Minitab, LLC" <techsupport@minitab.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2020-2023 Minitab, LLC
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://support.minitab.com/minitab/
29
+ Classifier: Development Status :: 5 - Production/Stable
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: Intended Audience :: End Users/Desktop
32
+ Classifier: Topic :: Scientific/Engineering
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3 :: Only
35
+ Classifier: Operating System :: OS Independent
36
+ Requires-Python: >=3.10
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE.txt
39
+ Requires-Dist: protobuf>=7.35.1
40
+ Requires-Dist: grpcio>=1.84.0
41
+ Dynamic: license-file
42
+
43
+ # mtbpy
44
+
45
+ The `mtbpy` package contains the `mtbpy` Python module, which provides the ability for Python
46
+ scripts to communicate with Minitab Statistical Software when executed via MSS's `PYSC` command.
@@ -0,0 +1,2 @@
1
+ protobuf>=7.35.1
2
+ grpcio>=1.84.0
@@ -1,45 +1,40 @@
1
- [project]
2
- name = "mtbpy"
3
- version = "1.0.1"
4
-
5
- description = "Module for communicating with Minitab from Python scripts executed via the PYSC command."
6
-
7
- license = {file = "LICENSE.txt"}
8
- readme = "README.md"
9
-
10
- authors = [
11
- {name = "Minitab, LLC", email = "techsupport@minitab.com" }
12
- ]
13
-
14
- classifiers = [
15
- "Development Status :: 5 - Production/Stable",
16
- "Intended Audience :: Developers",
17
- "Intended Audience :: End Users/Desktop",
18
- "Topic :: Scientific/Engineering",
19
- "License :: OSI Approved :: MIT License",
20
- "Programming Language :: Python :: 3 :: Only",
21
- "Operating System :: OS Independent"
22
- ]
23
-
24
- requires-python = ">= 3.7"
25
-
26
- dependencies = [
27
- "protobuf >= 3.20.0",
28
- "grpcio >= 1.26.0"
29
- ]
30
-
31
- [project.optional-dependencies]
32
- dev = [
33
- "grpcio-tools >= 1.51.3"
34
- ]
35
-
36
- [project.urls]
37
- "Homepage" = "https://support.minitab.com/minitab/"
38
-
39
- [build-system]
40
- requires = [
41
- "setuptools >= 43.0.0",
42
- "wheel"
43
- ]
44
-
45
- build-backend = "setuptools.build_meta"
1
+ [project]
2
+ name = "mtbpy"
3
+ version = "2.0.0"
4
+
5
+ description = "Module for communicating with Minitab from Python scripts executed via the PYSC command."
6
+
7
+ license = {file = "LICENSE.txt"}
8
+ readme = "README.md"
9
+
10
+ authors = [
11
+ {name = "Minitab, LLC", email = "techsupport@minitab.com" }
12
+ ]
13
+
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: End Users/Desktop",
18
+ "Topic :: Scientific/Engineering",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Operating System :: OS Independent"
22
+ ]
23
+
24
+ requires-python = ">= 3.10"
25
+
26
+ dependencies = [
27
+ "protobuf >= 7.35.1",
28
+ "grpcio >= 1.84.0"
29
+ ]
30
+
31
+ [project.urls]
32
+ "Homepage" = "https://support.minitab.com/minitab/"
33
+
34
+ [build-system]
35
+ requires = [
36
+ "setuptools >= 59.7.0",
37
+ "wheel >= 0.40.0"
38
+ ]
39
+
40
+ build-backend = "setuptools.build_meta"
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,5 +0,0 @@
1
- protobuf>=3.20.0
2
- grpcio>=1.26.0
3
-
4
- [dev]
5
- grpcio-tools>=1.51.3
File without changes
File without changes