structurize 3.4.1__tar.gz → 3.4.3__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 (90) hide show
  1. {structurize-3.4.1/structurize.egg-info → structurize-3.4.3}/PKG-INFO +1 -1
  2. {structurize-3.4.1 → structurize-3.4.3}/avrotize/_version.py +3 -3
  3. {structurize-3.4.1 → structurize-3.4.3}/avrotize/mcp_server.py +41 -4
  4. {structurize-3.4.1 → structurize-3.4.3/structurize.egg-info}/PKG-INFO +1 -1
  5. {structurize-3.4.1 → structurize-3.4.3}/.gitignore +0 -0
  6. {structurize-3.4.1 → structurize-3.4.3}/LICENSE +0 -0
  7. {structurize-3.4.1 → structurize-3.4.3}/MANIFEST.in +0 -0
  8. {structurize-3.4.1 → structurize-3.4.3}/README.md +0 -0
  9. {structurize-3.4.1 → structurize-3.4.3}/avrotize/__init__.py +0 -0
  10. {structurize-3.4.1 → structurize-3.4.3}/avrotize/__main__.py +0 -0
  11. {structurize-3.4.1 → structurize-3.4.3}/avrotize/asn1toavro.py +0 -0
  12. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotize.py +0 -0
  13. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotocpp.py +0 -0
  14. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotocsharp.py +0 -0
  15. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotocsv.py +0 -0
  16. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotodatapackage.py +0 -0
  17. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotodb.py +0 -0
  18. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotogo.py +0 -0
  19. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotographql.py +0 -0
  20. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotoiceberg.py +0 -0
  21. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotojava.py +0 -0
  22. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotojs.py +0 -0
  23. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotojsons.py +0 -0
  24. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotojstruct.py +0 -0
  25. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotokusto.py +0 -0
  26. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotomd.py +0 -0
  27. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotools.py +0 -0
  28. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotoparquet.py +0 -0
  29. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotoproto.py +0 -0
  30. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotopython.py +0 -0
  31. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotorust.py +0 -0
  32. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotots.py +0 -0
  33. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrotoxsd.py +0 -0
  34. {structurize-3.4.1 → structurize-3.4.3}/avrotize/avrovalidator.py +0 -0
  35. {structurize-3.4.1 → structurize-3.4.3}/avrotize/cddltostructure.py +0 -0
  36. {structurize-3.4.1 → structurize-3.4.3}/avrotize/choice_inference.py +0 -0
  37. {structurize-3.4.1 → structurize-3.4.3}/avrotize/commands.json +0 -0
  38. {structurize-3.4.1 → structurize-3.4.3}/avrotize/common.py +0 -0
  39. {structurize-3.4.1 → structurize-3.4.3}/avrotize/constants.py +0 -0
  40. {structurize-3.4.1 → structurize-3.4.3}/avrotize/csvtoavro.py +0 -0
  41. {structurize-3.4.1 → structurize-3.4.3}/avrotize/datapackagetoavro.py +0 -0
  42. {structurize-3.4.1 → structurize-3.4.3}/avrotize/dependencies/cpp/vcpkg/vcpkg.json +0 -0
  43. {structurize-3.4.1 → structurize-3.4.3}/avrotize/dependencies/typescript/node22/package.json +0 -0
  44. {structurize-3.4.1 → structurize-3.4.3}/avrotize/dependency_resolver.py +0 -0
  45. {structurize-3.4.1 → structurize-3.4.3}/avrotize/dependency_version.py +0 -0
  46. {structurize-3.4.1 → structurize-3.4.3}/avrotize/jsonstoavro.py +0 -0
  47. {structurize-3.4.1 → structurize-3.4.3}/avrotize/jsonstostructure.py +0 -0
  48. {structurize-3.4.1 → structurize-3.4.3}/avrotize/jsontoschema.py +0 -0
  49. {structurize-3.4.1 → structurize-3.4.3}/avrotize/jstructtoavro.py +0 -0
  50. {structurize-3.4.1 → structurize-3.4.3}/avrotize/kstructtoavro.py +0 -0
  51. {structurize-3.4.1 → structurize-3.4.3}/avrotize/kustotoavro.py +0 -0
  52. {structurize-3.4.1 → structurize-3.4.3}/avrotize/kustotojstruct.py +0 -0
  53. {structurize-3.4.1 → structurize-3.4.3}/avrotize/openapitostructure.py +0 -0
  54. {structurize-3.4.1 → structurize-3.4.3}/avrotize/parquettoavro.py +0 -0
  55. {structurize-3.4.1 → structurize-3.4.3}/avrotize/proto2parser.py +0 -0
  56. {structurize-3.4.1 → structurize-3.4.3}/avrotize/proto3parser.py +0 -0
  57. {structurize-3.4.1 → structurize-3.4.3}/avrotize/prototoavro.py +0 -0
  58. {structurize-3.4.1 → structurize-3.4.3}/avrotize/schema_inference.py +0 -0
  59. {structurize-3.4.1 → structurize-3.4.3}/avrotize/sqltoavro.py +0 -0
  60. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretocddl.py +0 -0
  61. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretocpp.py +0 -0
  62. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretocsharp.py +0 -0
  63. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretocsv.py +0 -0
  64. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretodatapackage.py +0 -0
  65. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretodb.py +0 -0
  66. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretogo.py +0 -0
  67. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretographql.py +0 -0
  68. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretoiceberg.py +0 -0
  69. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretojava.py +0 -0
  70. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretojs.py +0 -0
  71. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretojsons.py +0 -0
  72. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretokusto.py +0 -0
  73. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretomd.py +0 -0
  74. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretoproto.py +0 -0
  75. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretopython.py +0 -0
  76. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretorust.py +0 -0
  77. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretots.py +0 -0
  78. {structurize-3.4.1 → structurize-3.4.3}/avrotize/structuretoxsd.py +0 -0
  79. {structurize-3.4.1 → structurize-3.4.3}/avrotize/validate.py +0 -0
  80. {structurize-3.4.1 → structurize-3.4.3}/avrotize/xmltoschema.py +0 -0
  81. {structurize-3.4.1 → structurize-3.4.3}/avrotize/xsdtoavro.py +0 -0
  82. {structurize-3.4.1 → structurize-3.4.3}/build.ps1 +0 -0
  83. {structurize-3.4.1 → structurize-3.4.3}/build.sh +0 -0
  84. {structurize-3.4.1 → structurize-3.4.3}/pyproject.toml +0 -0
  85. {structurize-3.4.1 → structurize-3.4.3}/setup.cfg +0 -0
  86. {structurize-3.4.1 → structurize-3.4.3}/structurize.egg-info/SOURCES.txt +0 -0
  87. {structurize-3.4.1 → structurize-3.4.3}/structurize.egg-info/dependency_links.txt +0 -0
  88. {structurize-3.4.1 → structurize-3.4.3}/structurize.egg-info/entry_points.txt +0 -0
  89. {structurize-3.4.1 → structurize-3.4.3}/structurize.egg-info/requires.txt +0 -0
  90. {structurize-3.4.1 → structurize-3.4.3}/structurize.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structurize
3
- Version: 3.4.1
3
+ Version: 3.4.3
4
4
  Summary: Tools to convert from and to JSON Structure from various other schema languages.
5
5
  Author-email: Clemens Vasters <clemensv@microsoft.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '3.4.1'
32
- __version_tuple__ = version_tuple = (3, 4, 1)
31
+ __version__ = version = '3.4.3'
32
+ __version_tuple__ = version_tuple = (3, 4, 3)
33
33
 
34
- __commit_id__ = commit_id = 'g12ad80ab6'
34
+ __commit_id__ = commit_id = 'g1ee27c8b4'
@@ -46,7 +46,12 @@ def _build_namespace(command: Dict[str, Any], options: Dict[str, Any]) -> argpar
46
46
  default_value = arg.get("default", False if arg.get("type") == "bool" else None)
47
47
  setattr(namespace, dest, default_value)
48
48
  if dest in normalized_options:
49
- setattr(namespace, dest, _coerce_value(normalized_options[dest], arg["type"]))
49
+ raw_value = normalized_options[dest]
50
+ if arg.get("nargs") in {"+", "*"}:
51
+ values = raw_value if isinstance(raw_value, list) else [raw_value]
52
+ setattr(namespace, dest, [_coerce_value(v, arg["type"]) for v in values])
53
+ else:
54
+ setattr(namespace, dest, _coerce_value(raw_value, arg["type"]))
50
55
 
51
56
  return namespace
52
57
 
@@ -67,6 +72,33 @@ def _resolve_input_path(command_args: argparse.Namespace, explicit_input_path: s
67
72
  )
68
73
 
69
74
 
75
+ def _find_primary_input_arg(command: Dict[str, Any]) -> Dict[str, Any] | None:
76
+ return next(
77
+ (arg for arg in command.get("args", []) if isinstance(arg.get("name"), str) and not arg["name"].startswith("-")),
78
+ None,
79
+ )
80
+
81
+
82
+ def _inject_input_into_namespace(command: Dict[str, Any], command_args: argparse.Namespace, input_value: str) -> None:
83
+ primary_input_arg = _find_primary_input_arg(command)
84
+ if not primary_input_arg:
85
+ return
86
+
87
+ dest = _command_dest(primary_input_arg)
88
+ current_value = getattr(command_args, dest, None)
89
+
90
+ if primary_input_arg.get("nargs") in {"+", "*"}:
91
+ if current_value in (None, "", []):
92
+ setattr(command_args, dest, [input_value])
93
+ elif isinstance(current_value, list) and input_value not in current_value:
94
+ setattr(command_args, dest, [input_value, *current_value])
95
+ elif not isinstance(current_value, list):
96
+ setattr(command_args, dest, [input_value, current_value])
97
+ else:
98
+ if current_value in (None, ""):
99
+ setattr(command_args, dest, input_value)
100
+
101
+
70
102
  def _find_command(command_name: str) -> Dict[str, Any] | None:
71
103
  return next((cmd for cmd in load_commands() if cmd.get("command") == command_name), None)
72
104
 
@@ -138,9 +170,7 @@ def _execute_conversion(
138
170
  try:
139
171
  resolved_input = _resolve_input_path(command_args, input_path)
140
172
  skip_input_file_handling = command.get("skip_input_file_handling", False)
141
- if not skip_input_file_handling and not resolved_input:
142
- if input_content is None:
143
- raise ValueError("This command requires input_path or input_content.")
173
+ if input_content is not None and not resolved_input:
144
174
  temp_input = tempfile.NamedTemporaryFile(delete=False, mode="w", encoding="utf-8")
145
175
  temp_input.write(input_content)
146
176
  temp_input.flush()
@@ -148,6 +178,13 @@ def _execute_conversion(
148
178
  temp_input_path = temp_input.name
149
179
  resolved_input = temp_input_path
150
180
 
181
+ if not skip_input_file_handling and not resolved_input:
182
+ if input_content is None:
183
+ raise ValueError("This command requires input_path or input_content.")
184
+
185
+ if resolved_input:
186
+ _inject_input_into_namespace(command, command_args, resolved_input)
187
+
151
188
  if not output_path and any(v == "output_file_path" for v in command.get("function", {}).get("args", {}).values()):
152
189
  temp_output = tempfile.NamedTemporaryFile(delete=False, mode="w", encoding="utf-8")
153
190
  temp_output_path = temp_output.name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structurize
3
- Version: 3.4.1
3
+ Version: 3.4.3
4
4
  Summary: Tools to convert from and to JSON Structure from various other schema languages.
5
5
  Author-email: Clemens Vasters <clemensv@microsoft.com>
6
6
  Classifier: Programming Language :: Python :: 3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes