structurize 2.20.3__py3-none-any.whl → 2.20.5__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/__init__.py +2 -0
- avrotize/_version.py +3 -3
- avrotize/avrotocsharp.py +121 -16
- avrotize/commands.json +168 -9
- avrotize/constants.py +15 -0
- avrotize/jsonstostructure.py +234 -12
- avrotize/openapitostructure.py +717 -0
- avrotize/structuretojs.py +657 -0
- avrotize/structuretots.py +28 -3
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/METADATA +1 -1
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/RECORD +15 -13
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/WHEEL +0 -0
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/entry_points.txt +0 -0
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/licenses/LICENSE +0 -0
- {structurize-2.20.3.dist-info → structurize-2.20.5.dist-info}/top_level.txt +0 -0
avrotize/structuretots.py
CHANGED
|
@@ -595,7 +595,8 @@ class StructureToTypeScript:
|
|
|
595
595
|
type_name = qualified_name.split('.')[-1]
|
|
596
596
|
namespace = '.'.join(qualified_name.split('.')[:-1])
|
|
597
597
|
if namespace:
|
|
598
|
-
|
|
598
|
+
# Lowercase the namespace to match the directory structure created by write_to_file
|
|
599
|
+
relative_path = namespace.lower().replace('.', '/') + '/' + type_name
|
|
599
600
|
else:
|
|
600
601
|
relative_path = type_name
|
|
601
602
|
exports.append(f"export * from './{relative_path}.js';")
|
|
@@ -608,12 +609,19 @@ class StructureToTypeScript:
|
|
|
608
609
|
f.write(index_content)
|
|
609
610
|
|
|
610
611
|
def convert(self, structure_schema_path: str, output_dir: str, package_name: str = '') -> None:
|
|
611
|
-
"""
|
|
612
|
+
""" Converts a JSON Structure schema file to TypeScript classes """
|
|
612
613
|
self.output_dir = output_dir
|
|
613
614
|
|
|
614
615
|
# Load schema
|
|
615
616
|
with open(structure_schema_path, 'r', encoding='utf-8') as f:
|
|
616
|
-
|
|
617
|
+
schema = json.load(f)
|
|
618
|
+
|
|
619
|
+
self.convert_schema(schema, output_dir, package_name)
|
|
620
|
+
|
|
621
|
+
def convert_schema(self, schema: JsonNode, output_dir: str, package_name: str = '') -> None:
|
|
622
|
+
""" Converts a JSON Structure schema to TypeScript classes """
|
|
623
|
+
self.output_dir = output_dir
|
|
624
|
+
self.schema_doc = schema
|
|
617
625
|
|
|
618
626
|
# Register schema IDs
|
|
619
627
|
self.register_schema_ids(self.schema_doc)
|
|
@@ -651,3 +659,20 @@ def convert_structure_to_typescript(structure_schema_path: str, ts_file_path: st
|
|
|
651
659
|
"""
|
|
652
660
|
converter = StructureToTypeScript(package_name, typedjson_annotation, avro_annotation)
|
|
653
661
|
converter.convert(structure_schema_path, ts_file_path, package_name)
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
def convert_structure_schema_to_typescript(structure_schema: JsonNode, output_dir: str,
|
|
665
|
+
package_name: str = '', typedjson_annotation: bool = False,
|
|
666
|
+
avro_annotation: bool = False) -> None:
|
|
667
|
+
"""
|
|
668
|
+
Converts a JSON Structure schema to TypeScript classes.
|
|
669
|
+
|
|
670
|
+
Args:
|
|
671
|
+
structure_schema: JSON Structure schema to convert
|
|
672
|
+
output_dir: Output directory for TypeScript files
|
|
673
|
+
package_name: Package name for the generated TypeScript project
|
|
674
|
+
typedjson_annotation: Whether to include TypedJSON annotations
|
|
675
|
+
avro_annotation: Whether to include Avro annotations
|
|
676
|
+
"""
|
|
677
|
+
converter = StructureToTypeScript(package_name, typedjson_annotation, avro_annotation)
|
|
678
|
+
converter.convert_schema(structure_schema, output_dir, package_name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: structurize
|
|
3
|
-
Version: 2.20.
|
|
3
|
+
Version: 2.20.5
|
|
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,10 +1,10 @@
|
|
|
1
|
-
avrotize/__init__.py,sha256=
|
|
1
|
+
avrotize/__init__.py,sha256=t5h5wkHXr6M0mmHAB5rhjZ3Gxy9xutGTGIfojfao9rI,3820
|
|
2
2
|
avrotize/__main__.py,sha256=5pY8dYAURcOnFRvgb6fgaOIa_SOzPLIWbU8-ZTQ0jG4,88
|
|
3
|
-
avrotize/_version.py,sha256=
|
|
3
|
+
avrotize/_version.py,sha256=jlf47h63v98A9CED-ZIMrjMW-CTLDmgCg5AWV8hOW-k,714
|
|
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
|
-
avrotize/avrotocsharp.py,sha256=
|
|
7
|
+
avrotize/avrotocsharp.py,sha256=k-tBex_vT-79yKZNetP9pKF63206NlT7KKBIXies9Cg,71400
|
|
8
8
|
avrotize/avrotocsv.py,sha256=PaDEW2aGRFVNLwewWhJ3OwxbKFI3PBg_mTgtT4uLMko,3689
|
|
9
9
|
avrotize/avrotodatapackage.py,sha256=zSCphLvCYiBKRAUCdccsr-4JysH3PyAS6fSgwa65Tss,7259
|
|
10
10
|
avrotize/avrotodb.py,sha256=5fNJgz00VMimyOl7eI0lIxlcaN_JnN0mb2Q9lzCRecw,46989
|
|
@@ -25,18 +25,19 @@ avrotize/avrotorust.py,sha256=QMIBNkFpDlH44kuQo24k5D-f0lmdhoA5b7hEbhKsnMw,22214
|
|
|
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=
|
|
28
|
+
avrotize/commands.json,sha256=pD9H4fyT7nG2QBj-yLZc5JW-8JQsf2mnVjQ0k-Ubc5o,92489
|
|
29
29
|
avrotize/common.py,sha256=enqNR1I9-SbW7fNJE3w7N2R87kiN6_9Oa7VB4b2AUBc,31913
|
|
30
|
-
avrotize/constants.py,sha256=
|
|
30
|
+
avrotize/constants.py,sha256=AH9ITnLsGs-izJWhlZA30ADHYjV1P7NWumyvtU3mqrg,2627
|
|
31
31
|
avrotize/csvtoavro.py,sha256=TuIYm_Xv8gioEHl1YgWQKOYkFGGHfuwmK5RuEAEXbt8,4293
|
|
32
32
|
avrotize/datapackagetoavro.py,sha256=lw1S3H6UpKtjJj9ywDTuRw-qcihFx0vFJNPK7SlgKvY,2607
|
|
33
33
|
avrotize/dependency_resolver.py,sha256=LGOTutpobJ4kMjAwvs-l0Mt2tEoZFaXCazs-u38qnYk,19374
|
|
34
34
|
avrotize/dependency_version.py,sha256=tvbpO2VstTSTmNA5jbzQl48u6jnIM7BHyASQrrgsRYU,16844
|
|
35
35
|
avrotize/jsonstoavro.py,sha256=ZzigsCjAxw_TflXCjTLKHTrPmkiZRZMpuaZICfT_r_I,120069
|
|
36
|
-
avrotize/jsonstostructure.py,sha256=
|
|
36
|
+
avrotize/jsonstostructure.py,sha256=AXqrh3gJsQveWmC9Pfj1rTcUY_4KaDP7L9ObBSQehF4,147687
|
|
37
37
|
avrotize/jstructtoavro.py,sha256=sOq7Ru1b8_ZLCEsnBqx3gsMWd7dPAaYxoraAD0bz6rk,33891
|
|
38
38
|
avrotize/kstructtoavro.py,sha256=t97JY22n0uILK3WcvQu_Yp9ONvouJRLAC2bZ3rvZ1L0,2856
|
|
39
39
|
avrotize/kustotoavro.py,sha256=1oEk9mbqmP3N5-V7mBHSXpbSlYFzjJ7ajIDNJZxA1r8,21756
|
|
40
|
+
avrotize/openapitostructure.py,sha256=b86NYHHh8L9LF6-MD7jy57Pw80bo6pez-6Ve3F36hgs,31442
|
|
40
41
|
avrotize/parquettoavro.py,sha256=iAPrSYNkiH3fBKNVDfIgeXkQbAiopa252ULJrGgmBDI,5531
|
|
41
42
|
avrotize/proto2parser.py,sha256=__9R3cqiUJXc_efPCZZcF7rt18kA7mfhmX0qm2v0eSw,19742
|
|
42
43
|
avrotize/proto3parser.py,sha256=MfE84c-oAWWuzYmKlEZ5g5LUF7YzZaASFh2trX3UCaw,15604
|
|
@@ -51,20 +52,21 @@ avrotize/structuretogo.py,sha256=VCEUz-5J8uRqX1hWaTimtfVzEsIB-gs4wxa308rYD0s,324
|
|
|
51
52
|
avrotize/structuretographql.py,sha256=wcGXnrup5v5saRa1BhR6o-X8q8ujsQMVqrFHQTBPjww,20468
|
|
52
53
|
avrotize/structuretoiceberg.py,sha256=itKb33Kj-7-udk4eHTLmTEasIeh1ggpZ3e_bwCxLABM,15344
|
|
53
54
|
avrotize/structuretojava.py,sha256=jG2Vcf1KdezWrZo5lsecxLnmnMw1rA96uOxVWJQ4Rso,43372
|
|
55
|
+
avrotize/structuretojs.py,sha256=TJuhUGqn0F2omjPVcrPeFPHY2KynRceFg9gMGvEenxA,29608
|
|
54
56
|
avrotize/structuretojsons.py,sha256=PJrQBaf6yQHu5eFkePxbjPBEmL-fYfX2wj6OmH1jsWw,22495
|
|
55
57
|
avrotize/structuretokusto.py,sha256=rOKgYIcm7ZK8RS-VvMFPNzPzwtv7c4dIKU-fKjrJLyM,30618
|
|
56
58
|
avrotize/structuretomd.py,sha256=exfCldYbieVdduhotSoLrxsbphmyJQyeQso9qv4qyUw,13642
|
|
57
59
|
avrotize/structuretoproto.py,sha256=Aq0-fwMXSjjAxgZ5mq1kpo_TauigMRrJK9LNyoN-YGs,42679
|
|
58
60
|
avrotize/structuretopython.py,sha256=ePlXrwbqA9r63Vw6xL-Gq3hBUScdcF9aqCQSi_xtaGo,37980
|
|
59
61
|
avrotize/structuretorust.py,sha256=ChRmO7uzU-pMdDdS0Vtg-MVUaOaNhNUPwH-ZKKOHglU,35134
|
|
60
|
-
avrotize/structuretots.py,sha256=
|
|
62
|
+
avrotize/structuretots.py,sha256=bMBz9onD48nnFehg47x4wf8rUTghu_CucstkrZivqLk,32098
|
|
61
63
|
avrotize/structuretoxsd.py,sha256=01VpasyWSMOx04sILHLP7H-WkhGdXAEGKohUUfgrNf0,32797
|
|
62
64
|
avrotize/xsdtoavro.py,sha256=nQtNH_3pEZBp67oUCPqzhvItEExHTe-8obsIfNRXt8Y,19064
|
|
63
65
|
avrotize/dependencies/cpp/vcpkg/vcpkg.json,sha256=se5qnUVQ1Q6wN_DqgIioqKg_y7ouh9oly2iBAJJXkgw,414
|
|
64
66
|
avrotize/dependencies/typescript/node22/package.json,sha256=oAW_2X-b715kV7aajwuONZEMkyQUJGviG3GwnoUa7hU,387
|
|
65
|
-
structurize-2.20.
|
|
66
|
-
structurize-2.20.
|
|
67
|
-
structurize-2.20.
|
|
68
|
-
structurize-2.20.
|
|
69
|
-
structurize-2.20.
|
|
70
|
-
structurize-2.20.
|
|
67
|
+
structurize-2.20.5.dist-info/licenses/LICENSE,sha256=xGtQGygTETTtDQJafZCUbpsed3GxO6grmqig-jGEuSk,11348
|
|
68
|
+
structurize-2.20.5.dist-info/METADATA,sha256=pWPMxqIHiNmo4OoCpRgE28tSs4jGCb3xu2u710XANkk,3670
|
|
69
|
+
structurize-2.20.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
70
|
+
structurize-2.20.5.dist-info/entry_points.txt,sha256=biIH7jA5auhVqfbwHVk2gmD_gvrPYKgjpCAn0JWZ-Rs,55
|
|
71
|
+
structurize-2.20.5.dist-info/top_level.txt,sha256=yn-yQ0Cm1O9fbF8KJgv4IIvX4YRGelKgPqZF1wS5P50,9
|
|
72
|
+
structurize-2.20.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|