avrotize 2.22.2__py3-none-any.whl → 3.0.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.
- avrotize/_version.py +2 -2
- avrotize/avrotocsv.py +16 -0
- avrotize/avrotodb.py +4 -1
- avrotize/avrotogo.py +4 -4
- avrotize/commands.json +182 -4
- avrotize/structuretots.py +1 -1
- {avrotize-2.22.2.dist-info → avrotize-3.0.1.dist-info}/METADATA +71 -14
- {avrotize-2.22.2.dist-info → avrotize-3.0.1.dist-info}/RECORD +11 -11
- {avrotize-2.22.2.dist-info → avrotize-3.0.1.dist-info}/WHEEL +0 -0
- {avrotize-2.22.2.dist-info → avrotize-3.0.1.dist-info}/entry_points.txt +0 -0
- {avrotize-2.22.2.dist-info → avrotize-3.0.1.dist-info}/licenses/LICENSE +0 -0
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 = '
|
|
32
|
-
__version_tuple__ = version_tuple = (
|
|
31
|
+
__version__ = version = '3.0.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 0, 1)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
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/avrotodb.py
CHANGED
|
@@ -685,7 +685,10 @@ def convert_avro_to_nosql(avro_schema_path, nosql_file_path, nosql_dialect, emit
|
|
|
685
685
|
file_name = os.path.join(
|
|
686
686
|
nosql_file_path, get_file_name(schema_list, get_nosql_file_extension(nosql_dialect)))
|
|
687
687
|
with open(file_name, "w", encoding="utf-8") as nosql_file:
|
|
688
|
-
|
|
688
|
+
if isinstance(model, list):
|
|
689
|
+
nosql_file.write("\n".join(model))
|
|
690
|
+
else:
|
|
691
|
+
nosql_file.write(model)
|
|
689
692
|
|
|
690
693
|
def get_nosql_file_extension(nosql_dialect):
|
|
691
694
|
"""
|
avrotize/avrotogo.py
CHANGED
|
@@ -466,8 +466,8 @@ def convert_avro_to_go(avro_schema_path, go_file_path, package_name='', avro_ann
|
|
|
466
466
|
avrotogo = AvroToGo(package_name)
|
|
467
467
|
avrotogo.avro_annotation = avro_annotation
|
|
468
468
|
avrotogo.json_annotation = json_annotation
|
|
469
|
-
avrotogo.package_site = package_site
|
|
470
|
-
avrotogo.package_username = package_username
|
|
469
|
+
avrotogo.package_site = package_site if package_site else 'github.com'
|
|
470
|
+
avrotogo.package_username = package_username if package_username else 'username'
|
|
471
471
|
avrotogo.convert(avro_schema_path, go_file_path)
|
|
472
472
|
|
|
473
473
|
|
|
@@ -484,6 +484,6 @@ def convert_avro_schema_to_go(avro_schema: JsonNode, output_dir: str, package_na
|
|
|
484
484
|
avrotogo = AvroToGo(package_name)
|
|
485
485
|
avrotogo.avro_annotation = avro_annotation
|
|
486
486
|
avrotogo.json_annotation = json_annotation
|
|
487
|
-
avrotogo.package_site = package_site
|
|
488
|
-
avrotogo.package_username = package_username
|
|
487
|
+
avrotogo.package_site = package_site if package_site else 'github.com'
|
|
488
|
+
avrotogo.package_username = package_username if package_username else 'username'
|
|
489
489
|
avrotogo.convert_schema(avro_schema, output_dir)
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
3549
|
+
"command": "s2md",
|
|
3372
3550
|
"description": "Convert JSON Structure schema to Markdown documentation",
|
|
3373
3551
|
"group": "7_Utility",
|
|
3374
3552
|
"function": {
|
avrotize/structuretots.py
CHANGED
|
@@ -32,7 +32,7 @@ class StructureToTypeScript:
|
|
|
32
32
|
""" Converts JSON Structure schema to TypeScript classes """
|
|
33
33
|
|
|
34
34
|
def __init__(self, base_package: str = '', typedjson_annotation=False, avro_annotation=False) -> None:
|
|
35
|
-
self.base_package = base_package
|
|
35
|
+
self.base_package = base_package or ''
|
|
36
36
|
self.typedjson_annotation = typedjson_annotation
|
|
37
37
|
self.avro_annotation = avro_annotation
|
|
38
38
|
self.output_dir = os.getcwd()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avrotize
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.1
|
|
4
4
|
Summary: Tools to convert from and to Avro Schema from various other schema languages.
|
|
5
5
|
Author-email: Clemens Vasters <clemensv@microsoft.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -48,6 +48,14 @@ Provides-Extra: dev
|
|
|
48
48
|
|
|
49
49
|
# Avrotize & Structurize
|
|
50
50
|
|
|
51
|
+
[](https://pypi.org/project/avrotize/)
|
|
52
|
+
[](https://pypi.org/project/avrotize/)
|
|
53
|
+
[](https://github.com/clemensv/avrotize/actions/workflows/build_deploy.yml)
|
|
54
|
+
[](https://opensource.org/licenses/MIT)
|
|
55
|
+
[](https://pypi.org/project/avrotize/)
|
|
56
|
+
|
|
57
|
+
**[📚 Documentation & Examples](https://clemensv.github.io/avrotize/)** | **[🎨 Conversion Gallery](https://clemensv.github.io/avrotize/gallery/)**
|
|
58
|
+
|
|
51
59
|
Avrotize is a ["Rosetta Stone"](https://en.wikipedia.org/wiki/Rosetta_Stone) for data structure definitions, allowing you to convert between numerous data and database schema formats and to generate code for different programming languages.
|
|
52
60
|
|
|
53
61
|
It is, for instance, a well-documented and predictable converter and code generator for data structures originally defined in JSON Schema (of arbitrary complexity).
|
|
@@ -90,13 +98,13 @@ Converting from Avrotize Schema:
|
|
|
90
98
|
- [`avrotize a2k`](#convert-avrotize-schema-to-kusto-table-declaration) - Convert Avrotize Schema to Kusto table definition.
|
|
91
99
|
- [`avrotize s2k`](#convert-json-structure-schema-to-kusto-table-declaration) - Convert JSON Structure Schema to Kusto table definition.
|
|
92
100
|
- [`avrotize a2sql`](#convert-avrotize-schema-to-sql-table-definition) - Convert Avrotize Schema to SQL table definition.
|
|
93
|
-
- [`avrotize
|
|
101
|
+
- [`avrotize s2sql`](#convert-json-structure-schema-to-sql-schema) - Convert JSON Structure Schema to SQL table definition.
|
|
94
102
|
- [`avrotize a2pq`](#convert-avrotize-schema-to-empty-parquet-file) - Convert Avrotize Schema to Parquet or Iceberg schema.
|
|
95
103
|
- [`avrotize a2ib`](#convert-avrotize-schema-to-iceberg-schema) - Convert Avrotize Schema to Iceberg schema.
|
|
96
104
|
- [`avrotize s2ib`](#convert-json-structure-to-iceberg-schema) - Convert JSON Structure to Iceberg schema.
|
|
97
105
|
- [`avrotize a2mongo`](#convert-avrotize-schema-to-mongodb-schema) - Convert Avrotize Schema to MongoDB schema.
|
|
98
106
|
- [`avrotize a2cassandra`](#convert-avrotize-schema-to-cassandra-schema) - Convert Avrotize Schema to Cassandra schema.
|
|
99
|
-
- [`avrotize
|
|
107
|
+
- [`avrotize s2cassandra`](#convert-json-structure-schema-to-cassandra-schema) - Convert JSON Structure Schema to Cassandra schema.
|
|
100
108
|
- [`avrotize a2es`](#convert-avrotize-schema-to-elasticsearch-schema) - Convert Avrotize Schema to Elasticsearch schema.
|
|
101
109
|
- [`avrotize a2dynamodb`](#convert-avrotize-schema-to-dynamodb-schema) - Convert Avrotize Schema to DynamoDB schema.
|
|
102
110
|
- [`avrotize a2cosmos`](#convert-avrotize-schema-to-cosmosdb-schema) - Convert Avrotize Schema to CosmosDB schema.
|
|
@@ -106,7 +114,7 @@ Converting from Avrotize Schema:
|
|
|
106
114
|
- [`avrotize a2neo4j`](#convert-avrotize-schema-to-neo4j-schema) - Convert Avrotize Schema to Neo4j schema.
|
|
107
115
|
- [`avrotize a2dp`](#convert-avrotize-schema-to-datapackage-schema) - Convert Avrotize Schema to Datapackage schema.
|
|
108
116
|
- [`avrotize a2md`](#convert-avrotize-schema-to-markdown-documentation) - Convert Avrotize Schema to Markdown documentation.
|
|
109
|
-
- [`avrotize
|
|
117
|
+
- [`avrotize s2md`](#convert-json-structure-schema-to-markdown-documentation) - Convert JSON Structure schema to Markdown documentation.
|
|
110
118
|
|
|
111
119
|
Direct conversions (JSON Structure):
|
|
112
120
|
|
|
@@ -137,7 +145,10 @@ Generate code from JSON Structure:
|
|
|
137
145
|
Direct JSON Structure conversions:
|
|
138
146
|
|
|
139
147
|
- [`avrotize s2csv`](#convert-json-structure-to-csv-schema) - Convert JSON Structure schema to CSV schema.
|
|
148
|
+
- [`avrotize a2csv`](#convert-avrotize-schema-to-csv-schema) - Convert Avrotize schema to CSV schema.
|
|
140
149
|
- [`avrotize s2x`](#convert-json-structure-to-xml-schema-xsd) - Convert JSON Structure to XML Schema (XSD).
|
|
150
|
+
- [`avrotize s2graphql`](#convert-json-structure-schema-to-graphql-schema) - Convert JSON Structure schema to GraphQL schema.
|
|
151
|
+
- [`avrotize a2graphql`](#convert-avrotize-schema-to-graphql-schema) - Convert Avrotize schema to GraphQL schema.
|
|
141
152
|
|
|
142
153
|
Other commands:
|
|
143
154
|
|
|
@@ -147,10 +158,6 @@ JSON Structure conversions:
|
|
|
147
158
|
|
|
148
159
|
- [`avrotize s2dp`](#convert-json-structure-schema-to-datapackage-schema) - Convert JSON Structure schema to Datapackage schema.
|
|
149
160
|
|
|
150
|
-
Direct conversions (not via Avrotize Schema):
|
|
151
|
-
|
|
152
|
-
- [`avrotize struct2gql`](#convert-json-structure-schema-to-graphql-schema) - Convert JSON Structure schema to GraphQL schema.
|
|
153
|
-
|
|
154
161
|
## Overview
|
|
155
162
|
|
|
156
163
|
You can use Avrotize to convert between Avro/Avrotize Schema and other schema formats like JSON Schema, XML Schema (XSD), Protocol Buffers (Protobuf), ASN.1, and database schema formats like Kusto Data Table Definition (KQL) and SQL Table Definition. That means you can also convert from JSON Schema to Protobuf going via Avrotize Schema.
|
|
@@ -489,7 +496,7 @@ For detailed conversion rules and type mappings for each SQL dialect, refer to t
|
|
|
489
496
|
### Convert JSON Structure Schema to SQL Schema
|
|
490
497
|
|
|
491
498
|
```bash
|
|
492
|
-
avrotize
|
|
499
|
+
avrotize s2sql [input] --out <path_to_sql_script> --dialect <dialect> [--emit-cloudevents-columns]
|
|
493
500
|
```
|
|
494
501
|
|
|
495
502
|
Parameters:
|
|
@@ -545,7 +552,7 @@ Refer to the detailed conversion notes for Cassandra in the [NoSQL Conversion No
|
|
|
545
552
|
### Convert JSON Structure Schema to Cassandra Schema
|
|
546
553
|
|
|
547
554
|
```bash
|
|
548
|
-
avrotize
|
|
555
|
+
avrotize s2cassandra [input] --out <output_file> [--emit-cloudevents-columns]
|
|
549
556
|
```
|
|
550
557
|
|
|
551
558
|
Parameters:
|
|
@@ -1153,7 +1160,7 @@ Conversion notes:
|
|
|
1153
1160
|
### Convert JSON Structure schema to Markdown documentation
|
|
1154
1161
|
|
|
1155
1162
|
```bash
|
|
1156
|
-
avrotize
|
|
1163
|
+
avrotize s2md <path_to_structure_schema_file> [--out <path_to_markdown_file>]
|
|
1157
1164
|
```
|
|
1158
1165
|
|
|
1159
1166
|
Parameters:
|
|
@@ -1201,6 +1208,25 @@ Conversion notes:
|
|
|
1201
1208
|
- Enum and const keywords are supported and preserved in the output.
|
|
1202
1209
|
- JSON Structure-specific features like `$ref`, `$extends`, definitions, and namespaces are resolved during conversion.
|
|
1203
1210
|
|
|
1211
|
+
### Convert Avrotize Schema to CSV Schema
|
|
1212
|
+
|
|
1213
|
+
```bash
|
|
1214
|
+
avrotize a2csv <path_to_avro_schema_file> [--out <path_to_csv_schema_file>]
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
Parameters:
|
|
1218
|
+
|
|
1219
|
+
- `<path_to_avro_schema_file>`: The path to the Avrotize schema file to be converted. If omitted, the file is read from stdin.
|
|
1220
|
+
- `--out`: The path to the CSV schema file to write the conversion result to. If omitted, the output is directed to stdout.
|
|
1221
|
+
|
|
1222
|
+
Conversion notes:
|
|
1223
|
+
|
|
1224
|
+
- The tool converts Avrotize schemas to CSV Schema format.
|
|
1225
|
+
- Avro primitive types (string, int, long, float, double, boolean, bytes) are mapped to appropriate CSV schema types.
|
|
1226
|
+
- Avro logical types (date, timestamp-millis, decimal, uuid) are preserved in the output.
|
|
1227
|
+
- Complex types (records, arrays, maps) are represented as strings in CSV schema, as CSV format doesn't have native support for nested structures.
|
|
1228
|
+
- Only single record types can be converted to CSV schema.
|
|
1229
|
+
|
|
1204
1230
|
### Convert JSON Structure to Protocol Buffers
|
|
1205
1231
|
|
|
1206
1232
|
```bash
|
|
@@ -1283,7 +1309,7 @@ Conversion notes:
|
|
|
1283
1309
|
### Convert JSON Structure schema to GraphQL schema
|
|
1284
1310
|
|
|
1285
1311
|
```bash
|
|
1286
|
-
avrotize
|
|
1312
|
+
avrotize s2graphql [input] --out <path_to_graphql_schema_file>
|
|
1287
1313
|
```
|
|
1288
1314
|
|
|
1289
1315
|
Parameters:
|
|
@@ -1308,12 +1334,43 @@ Example:
|
|
|
1308
1334
|
|
|
1309
1335
|
```bash
|
|
1310
1336
|
# Convert a JSON Structure schema to GraphQL
|
|
1311
|
-
avrotize
|
|
1337
|
+
avrotize s2graphql myschema.struct.json --out myschema.graphql
|
|
1312
1338
|
|
|
1313
1339
|
# Read from stdin and write to stdout
|
|
1314
|
-
cat myschema.struct.json | avrotize
|
|
1340
|
+
cat myschema.struct.json | avrotize s2graphql > myschema.graphql
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
### Convert Avrotize schema to GraphQL schema
|
|
1344
|
+
|
|
1345
|
+
```bash
|
|
1346
|
+
avrotize a2graphql [input] --out <path_to_graphql_schema_file>
|
|
1315
1347
|
```
|
|
1316
1348
|
|
|
1349
|
+
Parameters:
|
|
1350
|
+
|
|
1351
|
+
- `[input]`: The path to the Avrotize schema file. If omitted, the file is read from stdin.
|
|
1352
|
+
- `--out <path_to_graphql_schema_file>`: The path to the output GraphQL schema file.
|
|
1353
|
+
|
|
1354
|
+
Conversion notes:
|
|
1355
|
+
|
|
1356
|
+
- Converts Avrotize schema to GraphQL schema language (SDL)
|
|
1357
|
+
- Avro primitive types (string, int, long, float, double, boolean, bytes) are mapped to GraphQL scalar types
|
|
1358
|
+
- Avro logical types (date, timestamp-millis, decimal, uuid) are mapped to custom GraphQL scalars
|
|
1359
|
+
- Avro record types become GraphQL object types
|
|
1360
|
+
- Avro arrays become GraphQL lists `[Type]`
|
|
1361
|
+
- Avro maps are represented using the JSON scalar type
|
|
1362
|
+
- Avro unions are converted to GraphQL union types
|
|
1363
|
+
- Avro enums become GraphQL enum types
|
|
1364
|
+
|
|
1365
|
+
Example:
|
|
1366
|
+
|
|
1367
|
+
```bash
|
|
1368
|
+
# Convert an Avrotize schema to GraphQL
|
|
1369
|
+
avrotize a2graphql myschema.avsc --out myschema.graphql
|
|
1370
|
+
|
|
1371
|
+
# Read from stdin and write to stdout
|
|
1372
|
+
cat myschema.avsc | avrotize a2graphql > myschema.graphql
|
|
1373
|
+
```
|
|
1317
1374
|
|
|
1318
1375
|
This document provides an overview of the usage and functionality of Avrotize. For more detailed information, please refer to the [Avrotize Schema documentation](specs/avrotize-schema.md) and the individual command help messages.
|
|
1319
1376
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
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=XH5H9yocjX6tjKCRt_lfsuS_IcI8mtuovnaeNUNnQTY,704
|
|
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=
|
|
8
|
+
avrotize/avrotocsv.py,sha256=yqVbP4Ar8bZyEgOAmHuHAsQKfCVjIO5_pa5dtaKLZKE,4575
|
|
9
9
|
avrotize/avrotodatapackage.py,sha256=zSCphLvCYiBKRAUCdccsr-4JysH3PyAS6fSgwa65Tss,7259
|
|
10
|
-
avrotize/avrotodb.py,sha256=
|
|
11
|
-
avrotize/avrotogo.py,sha256=
|
|
10
|
+
avrotize/avrotodb.py,sha256=IXqH5nHNgIErEIosxxSE5DIGzKJGk2FU2HIzmSt5eIs,47102
|
|
11
|
+
avrotize/avrotogo.py,sha256=9URV0SG8vvjadiNhXW12x_uRplO-JoHEqjIgViWWb4w,22545
|
|
12
12
|
avrotize/avrotographql.py,sha256=i6G7xWjH_Lsn_CLiM4BCPb8OyZuCCpsYjXwXNTRMwEE,7394
|
|
13
13
|
avrotize/avrotoiceberg.py,sha256=plVHGWkED1YDLcMDxL7NMdJl2f8G32hwlNWFrBLcsD8,9057
|
|
14
14
|
avrotize/avrotojava.py,sha256=NZZ7mUFVzvp7HBsU0XPiCwl4GVXE1RtS86pfNFJsIq8,135427
|
|
@@ -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=
|
|
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
|
|
@@ -59,7 +59,7 @@ avrotize/structuretomd.py,sha256=exfCldYbieVdduhotSoLrxsbphmyJQyeQso9qv4qyUw,136
|
|
|
59
59
|
avrotize/structuretoproto.py,sha256=Aq0-fwMXSjjAxgZ5mq1kpo_TauigMRrJK9LNyoN-YGs,42679
|
|
60
60
|
avrotize/structuretopython.py,sha256=d9EZVDHq7r-x0ZYZIRYfCP6kub7MkEROuvzjTJfNVv0,43958
|
|
61
61
|
avrotize/structuretorust.py,sha256=ChRmO7uzU-pMdDdS0Vtg-MVUaOaNhNUPwH-ZKKOHglU,35134
|
|
62
|
-
avrotize/structuretots.py,sha256=
|
|
62
|
+
avrotize/structuretots.py,sha256=zsN4ssX8rU4izOqXIiQcE0LQJ5wouydvCPoTWwSKXj4,35289
|
|
63
63
|
avrotize/structuretoxsd.py,sha256=01VpasyWSMOx04sILHLP7H-WkhGdXAEGKohUUfgrNf0,32797
|
|
64
64
|
avrotize/xsdtoavro.py,sha256=nQtNH_3pEZBp67oUCPqzhvItEExHTe-8obsIfNRXt8Y,19064
|
|
65
65
|
avrotize/avrotocpp/CMakeLists.txt.jinja,sha256=t2ADvvi3o20xfVrsRBaUvZlpVCDR4h6Szsf0GcuSkH0,3015
|
|
@@ -164,8 +164,8 @@ avrotize/structuretots/index.ts.jinja,sha256=-R4R_En1N4W_BEN3z3bLts9Xi4KnBTDLrYM
|
|
|
164
164
|
avrotize/structuretots/package.json.jinja,sha256=OfJn4g68VhBP-yvJCdsWm_1RHx1kphsmdWpxu_Fst1E,819
|
|
165
165
|
avrotize/structuretots/test_class.ts.jinja,sha256=7tJ6hPo3A9zToTkwolVyXYhmZ_E4uI_OnnYsUUzUEdQ,1180
|
|
166
166
|
avrotize/structuretots/tsconfig.json.jinja,sha256=8Pl65JW8uOMEexxkteobo0ZEqsJBO31HegNRUrf8XGQ,515
|
|
167
|
-
avrotize-
|
|
168
|
-
avrotize-
|
|
169
|
-
avrotize-
|
|
170
|
-
avrotize-
|
|
171
|
-
avrotize-
|
|
167
|
+
avrotize-3.0.1.dist-info/entry_points.txt,sha256=m8J2TWiqbZh7SBQezc1CNrM_GVPWf01zOFcAKhzCC0U,51
|
|
168
|
+
avrotize-3.0.1.dist-info/licenses/LICENSE,sha256=xGtQGygTETTtDQJafZCUbpsed3GxO6grmqig-jGEuSk,11348
|
|
169
|
+
avrotize-3.0.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
170
|
+
avrotize-3.0.1.dist-info/METADATA,sha256=zeQUZLtodaPUVrbaTaFtfWj80ErxsN7cO2CzzyZ0V00,83012
|
|
171
|
+
avrotize-3.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|