datacontract-cli 0.10.3__py3-none-any.whl → 0.10.4__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.

Potentially problematic release.


This version of datacontract-cli might be problematic. Click here for more details.

Files changed (33) hide show
  1. datacontract/breaking/breaking.py +12 -0
  2. datacontract/breaking/breaking_rules.py +4 -0
  3. datacontract/catalog/catalog.py +1 -0
  4. datacontract/cli.py +36 -8
  5. datacontract/data_contract.py +62 -128
  6. datacontract/export/avro_converter.py +16 -2
  7. datacontract/export/bigquery_converter.py +106 -0
  8. datacontract/export/go_converter.py +98 -0
  9. datacontract/export/html_export.py +3 -0
  10. datacontract/export/jsonschema_converter.py +45 -5
  11. datacontract/export/sql_converter.py +1 -0
  12. datacontract/export/sql_type_converter.py +42 -1
  13. datacontract/imports/avro_importer.py +14 -1
  14. datacontract/imports/bigquery_importer.py +166 -0
  15. datacontract/imports/jsonschema_importer.py +150 -0
  16. datacontract/model/data_contract_specification.py +55 -1
  17. datacontract/publish/publish.py +32 -0
  18. datacontract/templates/datacontract.html +37 -346
  19. datacontract/templates/index.html +67 -2
  20. datacontract/templates/partials/datacontract_information.html +66 -0
  21. datacontract/templates/partials/datacontract_servicelevels.html +253 -0
  22. datacontract/templates/partials/datacontract_terms.html +44 -0
  23. datacontract/templates/partials/definition.html +99 -0
  24. datacontract/templates/partials/example.html +27 -0
  25. datacontract/templates/partials/model_field.html +97 -0
  26. datacontract/templates/partials/server.html +144 -0
  27. datacontract/templates/style/output.css +94 -13
  28. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/METADATA +139 -96
  29. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/RECORD +33 -21
  30. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/LICENSE +0 -0
  31. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/WHEEL +0 -0
  32. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/entry_points.txt +0 -0
  33. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.4.dist-info}/top_level.txt +0 -0
@@ -566,6 +566,14 @@ video {
566
566
  border-width: 0;
567
567
  }
568
568
 
569
+ .pointer-events-none {
570
+ pointer-events: none;
571
+ }
572
+
573
+ .visible {
574
+ visibility: visible;
575
+ }
576
+
569
577
  .fixed {
570
578
  position: fixed;
571
579
  }
@@ -582,6 +590,15 @@ video {
582
590
  inset: 0px;
583
591
  }
584
592
 
593
+ .inset-y-0 {
594
+ top: 0px;
595
+ bottom: 0px;
596
+ }
597
+
598
+ .left-0 {
599
+ left: 0px;
600
+ }
601
+
585
602
  .right-0 {
586
603
  right: 0px;
587
604
  }
@@ -672,6 +689,10 @@ video {
672
689
  -webkit-line-clamp: 3;
673
690
  }
674
691
 
692
+ .block {
693
+ display: block;
694
+ }
695
+
675
696
  .inline-block {
676
697
  display: inline-block;
677
698
  }
@@ -736,6 +757,10 @@ video {
736
757
  width: 2.5rem;
737
758
  }
738
759
 
760
+ .w-2 {
761
+ width: 0.5rem;
762
+ }
763
+
739
764
  .w-2\/12 {
740
765
  width: 16.666667%;
741
766
  }
@@ -756,6 +781,14 @@ video {
756
781
  width: 58.333333%;
757
782
  }
758
783
 
784
+ .w-72 {
785
+ width: 18rem;
786
+ }
787
+
788
+ .w-9\/12 {
789
+ width: 75%;
790
+ }
791
+
759
792
  .w-full {
760
793
  width: 100%;
761
794
  }
@@ -833,11 +866,6 @@ video {
833
866
  column-gap: 1rem;
834
867
  }
835
868
 
836
- .gap-x-6 {
837
- -moz-column-gap: 1.5rem;
838
- column-gap: 1.5rem;
839
- }
840
-
841
869
  .gap-y-6 {
842
870
  row-gap: 1.5rem;
843
871
  }
@@ -925,6 +953,10 @@ video {
925
953
  border-radius: 0.375rem;
926
954
  }
927
955
 
956
+ .border-0 {
957
+ border-width: 0px;
958
+ }
959
+
928
960
  .bg-blue-50 {
929
961
  --tw-bg-opacity: 1;
930
962
  background-color: rgb(239 246 255 / var(--tw-bg-opacity));
@@ -1002,6 +1034,11 @@ video {
1002
1034
  padding-bottom: 0.25rem;
1003
1035
  }
1004
1036
 
1037
+ .py-1\.5 {
1038
+ padding-top: 0.375rem;
1039
+ padding-bottom: 0.375rem;
1040
+ }
1041
+
1005
1042
  .py-2 {
1006
1043
  padding-top: 0.5rem;
1007
1044
  padding-bottom: 0.5rem;
@@ -1024,6 +1061,14 @@ video {
1024
1061
  padding-bottom: 1.75rem;
1025
1062
  }
1026
1063
 
1064
+ .pl-10 {
1065
+ padding-left: 2.5rem;
1066
+ }
1067
+
1068
+ .pl-3 {
1069
+ padding-left: 0.75rem;
1070
+ }
1071
+
1027
1072
  .pl-4 {
1028
1073
  padding-left: 1rem;
1029
1074
  }
@@ -1215,10 +1260,6 @@ video {
1215
1260
  --tw-ring-opacity: 0.05;
1216
1261
  }
1217
1262
 
1218
- .filter {
1219
- filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1220
- }
1221
-
1222
1263
  .transition-all {
1223
1264
  transition-property: all;
1224
1265
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
@@ -1231,6 +1272,16 @@ video {
1231
1272
  transition-duration: 150ms;
1232
1273
  }
1233
1274
 
1275
+ .placeholder\:text-gray-400::-moz-placeholder {
1276
+ --tw-text-opacity: 1;
1277
+ color: rgb(156 163 175 / var(--tw-text-opacity));
1278
+ }
1279
+
1280
+ .placeholder\:text-gray-400::placeholder {
1281
+ --tw-text-opacity: 1;
1282
+ color: rgb(156 163 175 / var(--tw-text-opacity));
1283
+ }
1284
+
1234
1285
  .hover\:bg-gray-50:hover {
1235
1286
  --tw-bg-opacity: 1;
1236
1287
  background-color: rgb(249 250 251 / var(--tw-bg-opacity));
@@ -1251,6 +1302,21 @@ video {
1251
1302
  color: rgb(55 65 81 / var(--tw-text-opacity));
1252
1303
  }
1253
1304
 
1305
+ .focus\:ring-2:focus {
1306
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1307
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
1308
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
1309
+ }
1310
+
1311
+ .focus\:ring-inset:focus {
1312
+ --tw-ring-inset: inset;
1313
+ }
1314
+
1315
+ .focus\:ring-indigo-600:focus {
1316
+ --tw-ring-opacity: 1;
1317
+ --tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity));
1318
+ }
1319
+
1254
1320
  .focus-visible\:outline:focus-visible {
1255
1321
  outline-style: solid;
1256
1322
  }
@@ -1318,10 +1384,6 @@ video {
1318
1384
  flex-direction: row;
1319
1385
  }
1320
1386
 
1321
- .sm\:flex-col {
1322
- flex-direction: column;
1323
- }
1324
-
1325
1387
  .sm\:flex-wrap {
1326
1388
  flex-wrap: wrap;
1327
1389
  }
@@ -1330,12 +1392,22 @@ video {
1330
1392
  align-items: center;
1331
1393
  }
1332
1394
 
1395
+ .sm\:items-baseline {
1396
+ align-items: baseline;
1397
+ }
1398
+
1333
1399
  .sm\:space-x-6 > :not([hidden]) ~ :not([hidden]) {
1334
1400
  --tw-space-x-reverse: 0;
1335
1401
  margin-right: calc(1.5rem * var(--tw-space-x-reverse));
1336
1402
  margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
1337
1403
  }
1338
1404
 
1405
+ .sm\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
1406
+ --tw-space-x-reverse: 0;
1407
+ margin-right: calc(2rem * var(--tw-space-x-reverse));
1408
+ margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
1409
+ }
1410
+
1339
1411
  .sm\:truncate {
1340
1412
  overflow: hidden;
1341
1413
  text-overflow: ellipsis;
@@ -1373,6 +1445,15 @@ video {
1373
1445
  line-height: 2.25rem;
1374
1446
  }
1375
1447
 
1448
+ .sm\:text-sm {
1449
+ font-size: 0.875rem;
1450
+ line-height: 1.25rem;
1451
+ }
1452
+
1453
+ .sm\:leading-6 {
1454
+ line-height: 1.5rem;
1455
+ }
1456
+
1376
1457
  .sm\:tracking-tight {
1377
1458
  letter-spacing: -0.025em;
1378
1459
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datacontract-cli
3
- Version: 0.10.3
3
+ Version: 0.10.4
4
4
  Summary: Test data contracts
5
5
  Author-email: Jochen Christ <jochen.christ@innoq.com>, Stefan Negele <stefan.negele@innoq.com>
6
6
  Project-URL: Homepage, https://cli.datacontract.com
@@ -15,18 +15,18 @@ Requires-Dist: typer[all] <0.13,>=0.9
15
15
  Requires-Dist: pydantic <2.8.0,>=2.5.3
16
16
  Requires-Dist: pyyaml ~=6.0.1
17
17
  Requires-Dist: requests ~=2.31.0
18
- Requires-Dist: fastapi ==0.110.1
18
+ Requires-Dist: fastapi ==0.111.0
19
19
  Requires-Dist: fastparquet ==2024.2.0
20
20
  Requires-Dist: python-multipart ==0.0.9
21
21
  Requires-Dist: rich ~=13.7.0
22
- Requires-Dist: simple-ddl-parser ==1.1.0
22
+ Requires-Dist: simple-ddl-parser ==1.3.0
23
23
  Requires-Dist: soda-core-bigquery <3.4.0,>=3.3.1
24
24
  Requires-Dist: soda-core-duckdb <3.4.0,>=3.3.1
25
25
  Requires-Dist: soda-core-postgres <3.4.0,>=3.3.1
26
26
  Requires-Dist: soda-core-snowflake <3.4.0,>=3.3.1
27
27
  Requires-Dist: soda-core-spark[databricks] <3.4.0,>=3.3.1
28
28
  Requires-Dist: soda-core-spark-df <3.4.0,>=3.3.1
29
- Requires-Dist: snowflake-connector-python[pandas] <3.8,>=3.6
29
+ Requires-Dist: snowflake-connector-python[pandas] <3.11,>=3.6
30
30
  Requires-Dist: duckdb ==0.10.2
31
31
  Requires-Dist: fastjsonschema ~=2.19.1
32
32
  Requires-Dist: python-dotenv ~=1.0.0
@@ -36,8 +36,9 @@ Requires-Dist: avro ==1.11.3
36
36
  Requires-Dist: opentelemetry-exporter-otlp-proto-grpc ~=1.16.0
37
37
  Requires-Dist: opentelemetry-exporter-otlp-proto-http ~=1.16.0
38
38
  Requires-Dist: deltalake ~=0.17.0
39
- Requires-Dist: boto3 <1.34.70,>=1.34.41
40
- Requires-Dist: botocore <1.34.70,>=1.34.41
39
+ Requires-Dist: boto3 <1.34.99,>=1.34.41
40
+ Requires-Dist: botocore <1.34.99,>=1.34.41
41
+ Requires-Dist: jinja-partials >=0.2.1
41
42
  Provides-Extra: dev
42
43
  Requires-Dist: httpx ==0.27.0 ; extra == 'dev'
43
44
  Requires-Dist: ruff ; extra == 'dev'
@@ -166,7 +167,7 @@ $ datacontract test --examples datacontract.yaml
166
167
  # export data contract as html (other formats: avro, dbt, dbt-sources, dbt-staging-sql, jsonschema, odcs, rdf, sql, sodacl, terraform, ...)
167
168
  $ datacontract export --format html datacontract.yaml > datacontract.html
168
169
 
169
- # import avro (other formats: sql, ...)
170
+ # import avro (other formats: sql, glue, bigquery...)
170
171
  $ datacontract import --format avro --source avro_schema.avsc
171
172
 
172
173
  # find differences between to data contracts
@@ -235,6 +236,7 @@ Commands
235
236
  - [changelog](#changelog)
236
237
  - [diff](#diff)
237
238
  - [catalog](#catalog)
239
+ - [publish](#publish)
238
240
 
239
241
  ### init
240
242
 
@@ -244,16 +246,16 @@ Commands
244
246
  Download a datacontract.yaml template and write it to file.
245
247
 
246
248
  ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────╮
247
- │ location [LOCATION] The location (url or path) of the data contract yaml to create.
248
- │ [default: datacontract.yaml]
249
+ │ location [LOCATION] The location (url or path) of the data contract yaml to create.
250
+ │ [default: datacontract.yaml]
249
251
  ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
250
252
  ╭─ Options ────────────────────────────────────────────────────────────────────────────────────╮
251
- │ --template TEXT URL of a template or data contract
252
- │ [default:
253
- │ https://datacontract.com/datacontract.init.yaml]
254
- │ --overwrite --no-overwrite Replace the existing datacontract.yaml
255
- │ [default: no-overwrite]
256
- │ --help Show this message and exit.
253
+ │ --template TEXT URL of a template or data contract
254
+ │ [default:
255
+ │ https://datacontract.com/datacontract.init.yaml]
256
+ │ --overwrite --no-overwrite Replace the existing datacontract.yaml
257
+ │ [default: no-overwrite]
258
+ │ --help Show this message and exit.
257
259
  ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
258
260
  ```
259
261
 
@@ -265,12 +267,12 @@ Commands
265
267
  Validate that the datacontract.yaml is correctly formatted.
266
268
 
267
269
  ╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
268
- │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
270
+ │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
269
271
  ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
270
272
  ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
271
- │ --schema TEXT The location (url or path) of the Data Contract Specification JSON Schema
272
- │ [default: https://datacontract.com/datacontract.schema.json]
273
- │ --help Show this message and exit.
273
+ │ --schema TEXT The location (url or path) of the Data Contract Specification JSON Schema
274
+ │ [default: https://datacontract.com/datacontract.schema.json]
275
+ │ --help Show this message and exit.
274
276
  ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
275
277
  ```
276
278
 
@@ -282,28 +284,28 @@ Commands
282
284
  Run schema and quality tests on configured servers.
283
285
 
284
286
  ╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
285
- │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
287
+ │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
286
288
  ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
287
289
  ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
288
- │ --schema TEXT The location (url or path) of the Data Contract
289
- │ Specification JSON Schema
290
- │ [default:
291
- │ https://datacontract.com/datacontract.schema.json]
292
- │ --server TEXT The server configuration to run the schema and quality
293
- │ tests. Use the key of the server object in the data
294
- │ contract yaml file to refer to a server, e.g.,
295
- │ `production`, or `all` for all servers (default).
296
- │ [default: all]
297
- │ --examples --no-examples Run the schema and quality tests on the example data
298
- │ within the data contract.
299
- │ [default: no-examples]
300
- │ --publish TEXT The url to publish the results after the test
301
- │ [default: None]
302
- │ --publish-to-opentelemetry --no-publish-to-opentelemetry Publish the results to opentelemetry. Use environment
303
- │ variables to configure the OTLP endpoint, headers, etc.
304
- │ [default: no-publish-to-opentelemetry]
305
- │ --logs --no-logs Print logs [default: no-logs]
306
- │ --help Show this message and exit.
290
+ │ --schema TEXT The location (url or path) of the Data Contract
291
+ │ Specification JSON Schema
292
+ │ [default:
293
+ │ https://datacontract.com/datacontract.schema.json]
294
+ │ --server TEXT The server configuration to run the schema and quality
295
+ │ tests. Use the key of the server object in the data
296
+ │ contract yaml file to refer to a server, e.g.,
297
+ │ `production`, or `all` for all servers (default).
298
+ │ [default: all]
299
+ │ --examples --no-examples Run the schema and quality tests on the example data
300
+ │ within the data contract.
301
+ │ [default: no-examples]
302
+ │ --publish TEXT The url to publish the results after the test
303
+ │ [default: None]
304
+ │ --publish-to-opentelemetry --no-publish-to-opentelemetry Publish the results to opentelemetry. Use environment
305
+ │ variables to configure the OTLP endpoint, headers, etc.
306
+ │ [default: no-publish-to-opentelemetry]
307
+ │ --logs --no-logs Print logs [default: no-logs]
308
+ │ --help Show this message and exit.
307
309
  ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
308
310
  ```
309
311
 
@@ -607,26 +609,31 @@ models:
607
609
 
608
610
  Convert data contract to a specific format. Prints to stdout or to the specified output file.
609
611
 
610
- ╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
611
- │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
612
- ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
613
- ╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
614
- │ * --format [html|jsonschema|pydantic-model|sodacl|dbt|dbt-sources|dbt-staging-sql|odcs|rd The export format. [default: None] [required]
615
- f|avro|protobuf|great-expectations|terraform|avro-idl|sql|sql-query]
616
- --server TEXT The server name to export. [default: None]
617
- │ --model TEXT Use the key of the model in the data contract yaml file to refer to a
618
- model, e.g., `orders`, or `all` for all models (default).
619
- [default: all]
620
- │ --help Show this message and exit.
621
- ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
622
- ╭─ RDF Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
623
- --rdf-base TEXT [rdf] The base URI used to generate the RDF graph. [default: None]
624
- ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
625
- ╭─ SQL Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
626
- │ --sql-server-type TEXT [sql] The server type to determine the sql dialect. By default, it uses 'auto' to automatically detect the sql dialect via the specified │
627
- │ servers in the data contract. │
628
- [default: auto]
629
- ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
612
+ ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
613
+ │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml]
614
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
615
+ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
616
+ │ * --format [jsonschema|pydantic-model|sodacl|dbt|dbt-sources|dbt-staging The export format. [default: None] [required]
617
+ -sql|odcs|rdf|avro|protobuf|great-expectations|terraform|avro
618
+ -idl|sql|sql-query|html|bigquery|go]
619
+ │ --output PATH Specify the file path where the exported data will be saved.
620
+ If no path is provided, the output will be printed to stdout.
621
+ [default: None]
622
+ │ --server TEXT The server name to export. [default: None]
623
+ │ --model TEXT Use the key of the model in the data contract yaml file to │
624
+ │ refer to a model, e.g., `orders`, or `all` for all models │
625
+ (default).
626
+ │ [default: all] │
627
+ │ --help Show this message and exit. │
628
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
629
+ ╭─ RDF Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
630
+ --rdf-base TEXT [rdf] The base URI used to generate the RDF graph. [default: None]
631
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
632
+ ╭─ SQL Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
633
+ │ --sql-server-type TEXT [sql] The server type to determine the sql dialect. By default, it uses 'auto' to automatically detect the sql │
634
+ │ dialect via the specified servers in the data contract. │
635
+ │ [default: auto] │
636
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
630
637
 
631
638
  ```
632
639
 
@@ -639,22 +646,23 @@ Available export options:
639
646
 
640
647
  | Type | Description | Status |
641
648
  |----------------------|---------------------------------------------------------|--------|
642
- | `html` | Export to HTML | ✅ |
643
- | `jsonschema` | Export to JSON Schema | ✅ |
644
- | `odcs` | Export to Open Data Contract Standard (ODCS) | ✅ |
645
- | `sodacl` | Export to SodaCL quality checks in YAML format | ✅ |
646
- | `dbt` | Export to dbt models in YAML format | ✅ |
647
- | `dbt-sources` | Export to dbt sources in YAML format | ✅ |
648
- | `dbt-staging-sql` | Export to dbt staging SQL models | ✅ |
649
- | `rdf` | Export data contract to RDF representation in N3 format | ✅ |
650
- | `avro` | Export to AVRO models | ✅ |
651
- | `protobuf` | Export to Protobuf | ✅ |
652
- | `terraform` | Export to terraform resources | ✅ |
653
- | `sql` | Export to SQL DDL | ✅ |
654
- | `sql-query` | Export to SQL Query | ✅ |
655
- | `great-expectations` | Export to Great Expectations Suites in JSON Format | ✅ |
656
- | `bigquery` | Export to BigQuery Schemas | TBD |
657
- | `pydantic` | Export to pydantic models | TBD |
649
+ | `html` | Export to HTML | ✅ |
650
+ | `jsonschema` | Export to JSON Schema | ✅ |
651
+ | `odcs` | Export to Open Data Contract Standard (ODCS) | ✅ |
652
+ | `sodacl` | Export to SodaCL quality checks in YAML format | ✅ |
653
+ | `dbt` | Export to dbt models in YAML format | ✅ |
654
+ | `dbt-sources` | Export to dbt sources in YAML format | ✅ |
655
+ | `dbt-staging-sql` | Export to dbt staging SQL models | ✅ |
656
+ | `rdf` | Export data contract to RDF representation in N3 format | ✅ |
657
+ | `avro` | Export to AVRO models | ✅ |
658
+ | `protobuf` | Export to Protobuf | ✅ |
659
+ | `terraform` | Export to terraform resources | ✅ |
660
+ | `sql` | Export to SQL DDL | ✅ |
661
+ | `sql-query` | Export to SQL Query | ✅ |
662
+ | `great-expectations` | Export to Great Expectations Suites in JSON Format | ✅ |
663
+ | `bigquery` | Export to BigQuery Schemas | |
664
+ | `go` | Export to Go types | |
665
+ | `pydantic-model` | Export to pydantic models | ✅ |
658
666
  | Missing something? | Please create an issue on GitHub | TBD |
659
667
 
660
668
  #### Great Expectations
@@ -702,29 +710,49 @@ data products, find the true domain owner of a field attribute)
702
710
 
703
711
  Create a data contract from the given source location. Prints to stdout.
704
712
 
705
- ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
706
- │ * --format [sql|avro|glue] The format of the source file. [default: None] [required]
707
- * --source TEXT The path to the file or Glue Database that should be imported. [default: None] [required]
708
- │ --help Show this message and exit.
709
- ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
713
+ ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
714
+ │ * --format [sql|avro|glue|bigquery|jsonschema] The format of the source file. [default: None] [required]
715
+ --source TEXT The path to the file or Glue Database that should be imported. [default: None]
716
+ │ --bigquery-project TEXT The bigquery project id. [default: None]
717
+ │ --bigquery-dataset TEXT The bigquery dataset id. [default: None] │
718
+ │ --bigquery-table TEXT List of table ids to import from the bigquery API (repeat for multiple table ids, leave empty for all │
719
+ │ tables in the dataset). │
720
+ │ [default: None] │
721
+ │ --help Show this message and exit. │
722
+ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
710
723
  ```
711
724
 
725
+ As shown, some options are only relevant in certain conditions: For `format` Bigtable we support to directly read off the Bigtable APIs.
726
+ In this case there's no need to specify `source` but instead `bt-project-id`, `bt-dataset-id` and `table` must be specified.
727
+
728
+ For providing authentication to the Client, please see [the google documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to) or the one [about authorizing client libraries](https://cloud.google.com/bigquery/docs/authentication#client-libs).
729
+
712
730
  Example:
713
731
  ```bash
714
732
  # Example import from SQL DDL
715
733
  datacontract import --format sql --source my_ddl.sql
716
734
  ```
717
735
 
736
+ ```bash
737
+ # Example import from Bigquery JSON
738
+ datacontract import --format bigquery --source my_bigquery_table.json
739
+ ```
740
+
741
+ ```bash
742
+ # Example import from Bigquery API
743
+ datacontract import --format bigquery --btProjectId <project_id> --btDatasetId <dataset_id> --table <tableid_1> --table <tableid_2> --table <tableid_3>
744
+ ```
745
+
718
746
  Available import options:
719
747
 
720
748
  | Type | Description | Status |
721
749
  |--------------------|------------------------------------------------|---------|
722
- | `sql` | Import from SQL DDL | ✅ |
723
- | `avro` | Import from AVRO schemas | ✅ |
724
- | `glue` | Import from AWS Glue DataCatalog | ✅ |
750
+ | `sql` | Import from SQL DDL | ✅ |
751
+ | `avro` | Import from AVRO schemas | ✅ |
752
+ | `glue` | Import from AWS Glue DataCatalog | ✅ |
725
753
  | `protobuf` | Import from Protobuf schemas | TBD |
726
- | `jsonschema` | Import from JSON Schemas | TBD |
727
- | `bigquery` | Import from BigQuery Schemas | TBD |
754
+ | `jsonschema` | Import from JSON Schemas | |
755
+ | `bigquery` | Import from BigQuery Schemas | |
728
756
  | `dbt` | Import from dbt models | TBD |
729
757
  | `odcs` | Import from Open Data Contract Standard (ODCS) | TBD |
730
758
  | Missing something? | Please create an issue on GitHub | TBD |
@@ -738,11 +766,11 @@ Available import options:
738
766
  Identifies breaking changes between data contracts. Prints to stdout.
739
767
 
740
768
  ╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
741
- │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
742
- │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
769
+ │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
770
+ │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
743
771
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
744
772
  ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
745
- │ --help Show this message and exit.
773
+ │ --help Show this message and exit.
746
774
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
747
775
  ```
748
776
 
@@ -754,11 +782,11 @@ Available import options:
754
782
  Generate a changelog between data contracts. Prints to stdout.
755
783
 
756
784
  ╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
757
- │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
758
- │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
785
+ │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
786
+ │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
759
787
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
760
788
  ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
761
- │ --help Show this message and exit.
789
+ │ --help Show this message and exit.
762
790
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
763
791
  ```
764
792
 
@@ -770,8 +798,8 @@ Available import options:
770
798
  PLACEHOLDER. Currently works as 'changelog' does.
771
799
 
772
800
  ╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
773
- │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
774
- │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
801
+ │ * location_old TEXT The location (url or path) of the old data contract yaml. [default: None] [required]
802
+ │ * location_new TEXT The location (url or path) of the new data contract yaml. [default: None] [required]
775
803
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
776
804
  ╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
777
805
  │ --help Show this message and exit. │
@@ -787,12 +815,27 @@ Available import options:
787
815
  Create an html catalog of data contracts.
788
816
 
789
817
  ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
790
- │ --files TEXT Glob pattern for the data contract files to include in the catalog. [default: *.yaml]
791
- │ --output TEXT Output directory for the catalog html files. [default: catalog/]
792
- │ --help Show this message and exit.
818
+ │ --files TEXT Glob pattern for the data contract files to include in the catalog. [default: *.yaml]
819
+ │ --output TEXT Output directory for the catalog html files. [default: catalog/]
820
+ │ --help Show this message and exit.
793
821
  ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
794
822
  ```
795
823
 
824
+ ### Publish
825
+
826
+ ```
827
+
828
+ Usage: datacontract publish [OPTIONS] [LOCATION]
829
+
830
+ Publish the data contract to the Data Mesh Manager.
831
+
832
+ ╭─ Arguments ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
833
+ │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml] │
834
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
835
+ ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
836
+ │ --help Show this message and exit. │
837
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
838
+ ```
796
839
 
797
840
  ## Integrations
798
841