structurize 2.22.2__py3-none-any.whl → 3.0.0__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.
avrotize/_version.py CHANGED
@@ -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 = '2.22.2'
32
- __version_tuple__ = version_tuple = (2, 22, 2)
31
+ __version__ = version = '3.0.0'
32
+ __version_tuple__ = version_tuple = (3, 0, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g25efcf5da'
34
+ __commit_id__ = commit_id = 'gb201f8a65'
avrotize/avrotocsv.py CHANGED
@@ -39,7 +39,23 @@ class AvroToCSVSchemaConverter:
39
39
 
40
40
  :param avro_schema: Avro schema as a dictionary.
41
41
  :return: CSV schema as a dictionary.
42
+ :raises ValueError: If the schema is not a single record type.
42
43
  """
44
+ # Handle schema arrays (unions of records) - not supported
45
+ if isinstance(avro_schema, list):
46
+ raise ValueError(
47
+ "CSV schema conversion only supports single record schemas. "
48
+ "The provided schema is an array/union of multiple types. "
49
+ "Use --record-type to specify a single record type if available."
50
+ )
51
+
52
+ # Ensure it's a record type with fields
53
+ if not isinstance(avro_schema, dict) or 'fields' not in avro_schema:
54
+ raise ValueError(
55
+ "CSV schema conversion only supports Avro record types with 'fields'. "
56
+ f"The provided schema has type: {avro_schema.get('type', 'unknown') if isinstance(avro_schema, dict) else type(avro_schema).__name__}"
57
+ )
58
+
43
59
  csv_schema = {
44
60
  "fields": []
45
61
  }
avrotize/commands.json CHANGED
@@ -649,6 +649,108 @@
649
649
  }
650
650
  ]
651
651
  },
652
+ {
653
+ "command": "s2k",
654
+ "description": "Convert JSON Structure schema to Kusto table schemas",
655
+ "group": "4_RTDB",
656
+ "function": {
657
+ "name": "avrotize.structuretokusto.convert_structure_to_kusto",
658
+ "args": {
659
+ "structure_schema_path": "input_file_path",
660
+ "kusto_file_path": "output_file_path",
661
+ "kusto_uri": "args.kusto_uri",
662
+ "kusto_database": "args.kusto_database",
663
+ "structure_record_type": "args.record_type",
664
+ "emit_cloudevents_columns": "args.emit_cloudevents_columns",
665
+ "emit_cloudevents_dispatch_table": "args.emit_cloudevents_dispatch"
666
+ }
667
+ },
668
+ "extensions": [
669
+ ".struct.json",
670
+ ".json"
671
+ ],
672
+ "args": [
673
+ {
674
+ "name": "input",
675
+ "type": "str",
676
+ "nargs": "?",
677
+ "help": "Path to the JSON Structure schema file (or read from stdin if omitted)",
678
+ "required": false
679
+ },
680
+ {
681
+ "name": "--out",
682
+ "type": "str",
683
+ "help": "Path to the Kusto table schema file",
684
+ "required": false
685
+ },
686
+ {
687
+ "name": "--struct",
688
+ "type": "str",
689
+ "help": "Deprecated: Path to the JSON Structure schema file (for backcompat)",
690
+ "required": false
691
+ },
692
+ {
693
+ "name": "--kusto-uri",
694
+ "type": "str",
695
+ "help": "Kusto Cluster URI to apply the generated schema to.",
696
+ "required": false
697
+ },
698
+ {
699
+ "name": "--kusto-database",
700
+ "type": "str",
701
+ "help": "Kusto database name to apply the generated schema to",
702
+ "required": false
703
+ },
704
+ {
705
+ "name": "--record-type",
706
+ "type": "str",
707
+ "help": "Record type in the JSON Structure schema",
708
+ "required": false
709
+ },
710
+ {
711
+ "name": "--emit-cloudevents-columns",
712
+ "type": "bool",
713
+ "help": "Add CloudEvents columns to the Kusto table",
714
+ "default": false,
715
+ "required": false
716
+ },
717
+ {
718
+ "name": "--emit-cloudevents-dispatch",
719
+ "type": "bool",
720
+ "help": "Emit a _cloudevents_dispatch ingestion table and update policies for each generated table",
721
+ "required": false
722
+ }
723
+ ],
724
+ "suggested_output_file_path": "{input_file_name}.kql",
725
+ "prompts": [
726
+ {
727
+ "name": "--kusto-uri",
728
+ "message": "Enter the Kusto Cluster URI (optional)",
729
+ "type": "str",
730
+ "required": false
731
+ },
732
+ {
733
+ "name": "--kusto-database",
734
+ "message": "Enter the Kusto database name (optional)",
735
+ "type": "str",
736
+ "required": false
737
+ },
738
+ {
739
+ "name": "--emit-cloudevents-columns",
740
+ "message": "Add CloudEvents columns to the Kusto table?",
741
+ "type": "bool",
742
+ "default": false,
743
+ "required": false
744
+ },
745
+ {
746
+ "name": "--emit-cloudevents-dispatch",
747
+ "message": "Emit a _cloudevents_dispatch ingestion table and update policies?",
748
+ "type": "bool",
749
+ "default": false,
750
+ "required": false
751
+ }
752
+ ]
753
+ },
652
754
  {
653
755
  "command": "k2a",
654
756
  "description": "Convert Kusto schema to Avrotize schema",
@@ -836,7 +938,7 @@
836
938
  ]
837
939
  },
838
940
  {
839
- "command": "struct2sql",
941
+ "command": "s2sql",
840
942
  "description": "Convert JSON Structure schema to SQL schema",
841
943
  "group": "5_SQL",
842
944
  "function": {
@@ -1821,6 +1923,44 @@
1821
1923
  "suggested_output_file_path": "{input_file_name}.csv.json",
1822
1924
  "prompts": []
1823
1925
  },
1926
+ {
1927
+ "command": "a2csv",
1928
+ "description": "Convert Avrotize schema to CSV schema",
1929
+ "group": "1_Schemas",
1930
+ "function": {
1931
+ "name": "avrotize.avrotocsv.convert_avro_to_csv_schema",
1932
+ "args": {
1933
+ "avro_schema_path": "input_file_path",
1934
+ "csv_schema_path": "output_file_path"
1935
+ }
1936
+ },
1937
+ "extensions": [
1938
+ ".avsc"
1939
+ ],
1940
+ "args": [
1941
+ {
1942
+ "name": "input",
1943
+ "type": "str",
1944
+ "nargs": "?",
1945
+ "help": "Path to the Avrotize schema file (or read from stdin if omitted)",
1946
+ "required": false
1947
+ },
1948
+ {
1949
+ "name": "--out",
1950
+ "type": "str",
1951
+ "help": "Output path for the CSV schema file",
1952
+ "required": false
1953
+ },
1954
+ {
1955
+ "name": "--avsc",
1956
+ "type": "str",
1957
+ "help": "Deprecated: Path to the Avrotize schema file (for backcompat)",
1958
+ "required": false
1959
+ }
1960
+ ],
1961
+ "suggested_output_file_path": "{input_file_name}.csv.json",
1962
+ "prompts": []
1963
+ },
1824
1964
  {
1825
1965
  "command": "s2rust",
1826
1966
  "description": "Convert JSON Structure to Rust classes",
@@ -2147,7 +2287,7 @@
2147
2287
  ]
2148
2288
  },
2149
2289
  {
2150
- "command": "struct2gql",
2290
+ "command": "s2graphql",
2151
2291
  "description": "Convert JSON Structure schema to GraphQL schema",
2152
2292
  "group": "1_Schemas",
2153
2293
  "function": {
@@ -2179,6 +2319,44 @@
2179
2319
  "suggested_output_file_path": "{input_file_name}.graphql",
2180
2320
  "prompts": []
2181
2321
  },
2322
+ {
2323
+ "command": "a2graphql",
2324
+ "description": "Convert Avrotize schema to GraphQL schema",
2325
+ "group": "1_Schemas",
2326
+ "function": {
2327
+ "name": "avrotize.avrotographql.convert_avro_to_graphql",
2328
+ "args": {
2329
+ "avro_schema_path": "input_file_path",
2330
+ "graphql_schema_path": "output_file_path"
2331
+ }
2332
+ },
2333
+ "extensions": [
2334
+ ".avsc"
2335
+ ],
2336
+ "args": [
2337
+ {
2338
+ "name": "input",
2339
+ "type": "str",
2340
+ "nargs": "?",
2341
+ "help": "Path to the Avrotize schema file (or read from stdin if omitted)",
2342
+ "required": false
2343
+ },
2344
+ {
2345
+ "name": "--out",
2346
+ "type": "str",
2347
+ "help": "Path to the GraphQL schema file",
2348
+ "required": false
2349
+ },
2350
+ {
2351
+ "name": "--avsc",
2352
+ "type": "str",
2353
+ "help": "Deprecated: Path to the Avrotize schema file (for backcompat)",
2354
+ "required": false
2355
+ }
2356
+ ],
2357
+ "suggested_output_file_path": "{input_file_name}.graphql",
2358
+ "prompts": []
2359
+ },
2182
2360
  {
2183
2361
  "command": "a2ts",
2184
2362
  "description": "Convert Avrotize schema to TypeScript classes",
@@ -2824,7 +3002,7 @@
2824
3002
  ]
2825
3003
  },
2826
3004
  {
2827
- "command": "struct2cassandra",
3005
+ "command": "s2cassandra",
2828
3006
  "description": "Convert JSON Structure schema to Cassandra schema",
2829
3007
  "group": "5_SQL",
2830
3008
  "function": {
@@ -3368,7 +3546,7 @@
3368
3546
  "prompts": []
3369
3547
  },
3370
3548
  {
3371
- "command": "struct2md",
3549
+ "command": "s2md",
3372
3550
  "description": "Convert JSON Structure schema to Markdown documentation",
3373
3551
  "group": "7_Utility",
3374
3552
  "function": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structurize
3
- Version: 2.22.2
3
+ Version: 3.0.0
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
@@ -1,11 +1,11 @@
1
1
  avrotize/__init__.py,sha256=t5h5wkHXr6M0mmHAB5rhjZ3Gxy9xutGTGIfojfao9rI,3820
2
2
  avrotize/__main__.py,sha256=5pY8dYAURcOnFRvgb6fgaOIa_SOzPLIWbU8-ZTQ0jG4,88
3
- avrotize/_version.py,sha256=Tzal6KLkKmissU9BbKc9vPD8BYI6Pb3CVLukFXfsTYY,714
3
+ avrotize/_version.py,sha256=W-cwokhUzBb_YkyLsLDGHLup9GgiFHu3vD4v2z-lKlY,712
4
4
  avrotize/asn1toavro.py,sha256=QDNwfBfXMxSH-k487CA3CaGCGDzOLs4PpVbbENm5uF0,8386
5
5
  avrotize/avrotize.py,sha256=VHFpBltMVBpyt0ju3ZWW725BKjQ4Fk-nrAy8udW-X44,5713
6
6
  avrotize/avrotocpp.py,sha256=hRZV247_TDD7Sm6_8sFx-UH5SueLLx2Wg6TvAVUX0iE,25693
7
7
  avrotize/avrotocsharp.py,sha256=jOx9ctuUSsdpNDEXnNNfFHOb8zWWHclUvYTF5rInOaM,72339
8
- avrotize/avrotocsv.py,sha256=PaDEW2aGRFVNLwewWhJ3OwxbKFI3PBg_mTgtT4uLMko,3689
8
+ avrotize/avrotocsv.py,sha256=yqVbP4Ar8bZyEgOAmHuHAsQKfCVjIO5_pa5dtaKLZKE,4575
9
9
  avrotize/avrotodatapackage.py,sha256=zSCphLvCYiBKRAUCdccsr-4JysH3PyAS6fSgwa65Tss,7259
10
10
  avrotize/avrotodb.py,sha256=5fNJgz00VMimyOl7eI0lIxlcaN_JnN0mb2Q9lzCRecw,46989
11
11
  avrotize/avrotogo.py,sha256=H4jxdO7laRWKJuU6mytz2sgUa_20hZUlsBrUGrCe_UU,22405
@@ -25,7 +25,7 @@ avrotize/avrotorust.py,sha256=HEcDirRBCbXQNNs_FmkT-sp1dWQgZ8A23qkQYUxVuXE,24255
25
25
  avrotize/avrotots.py,sha256=u_XLjlHN0Gof5QYlpqK4X9WoX9rL30TjQMPg4TiyYnI,33241
26
26
  avrotize/avrotoxsd.py,sha256=iGQq_8kC0kfKsqvqS6s_mO-kJ8N5G8vXOwqRI_DZUxc,17744
27
27
  avrotize/cddltostructure.py,sha256=MA2c-P3CIEAxEaBX-FF299gR55xcLEV3FrfTr2QfayM,74491
28
- avrotize/commands.json,sha256=I36P5rEoL8cqcx4P8a_VhXyGsg6NHRPiByQbofYYWj8,93350
28
+ avrotize/commands.json,sha256=3N1Jblh-_o2GRbhcrMXLUEf0pijsYu6ff-nAbT5nhTE,98316
29
29
  avrotize/common.py,sha256=enqNR1I9-SbW7fNJE3w7N2R87kiN6_9Oa7VB4b2AUBc,31913
30
30
  avrotize/constants.py,sha256=LlgHrvT6RsRPrhFGRNHmFuIj3b1bSd45yC4rBCIGGVA,2753
31
31
  avrotize/csvtoavro.py,sha256=TuIYm_Xv8gioEHl1YgWQKOYkFGGHfuwmK5RuEAEXbt8,4293
@@ -64,9 +64,9 @@ avrotize/structuretoxsd.py,sha256=01VpasyWSMOx04sILHLP7H-WkhGdXAEGKohUUfgrNf0,32
64
64
  avrotize/xsdtoavro.py,sha256=nQtNH_3pEZBp67oUCPqzhvItEExHTe-8obsIfNRXt8Y,19064
65
65
  avrotize/dependencies/cpp/vcpkg/vcpkg.json,sha256=se5qnUVQ1Q6wN_DqgIioqKg_y7ouh9oly2iBAJJXkgw,414
66
66
  avrotize/dependencies/typescript/node22/package.json,sha256=oAW_2X-b715kV7aajwuONZEMkyQUJGviG3GwnoUa7hU,387
67
- structurize-2.22.2.dist-info/licenses/LICENSE,sha256=xGtQGygTETTtDQJafZCUbpsed3GxO6grmqig-jGEuSk,11348
68
- structurize-2.22.2.dist-info/METADATA,sha256=VbLggwPdkdLWlW4sh9kH8tAIsDI44006ZLwfbP71bvw,3670
69
- structurize-2.22.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- structurize-2.22.2.dist-info/entry_points.txt,sha256=biIH7jA5auhVqfbwHVk2gmD_gvrPYKgjpCAn0JWZ-Rs,55
71
- structurize-2.22.2.dist-info/top_level.txt,sha256=yn-yQ0Cm1O9fbF8KJgv4IIvX4YRGelKgPqZF1wS5P50,9
72
- structurize-2.22.2.dist-info/RECORD,,
67
+ structurize-3.0.0.dist-info/licenses/LICENSE,sha256=xGtQGygTETTtDQJafZCUbpsed3GxO6grmqig-jGEuSk,11348
68
+ structurize-3.0.0.dist-info/METADATA,sha256=yI3BQ6cxAHy8xyPO9FPP80T_aH3izDiJ4qbUjvlB9Fo,3669
69
+ structurize-3.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ structurize-3.0.0.dist-info/entry_points.txt,sha256=biIH7jA5auhVqfbwHVk2gmD_gvrPYKgjpCAn0JWZ-Rs,55
71
+ structurize-3.0.0.dist-info/top_level.txt,sha256=yn-yQ0Cm1O9fbF8KJgv4IIvX4YRGelKgPqZF1wS5P50,9
72
+ structurize-3.0.0.dist-info/RECORD,,