cognite-toolkit 0.6.97__py3-none-any.whl → 0.7.39__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.
Files changed (198) hide show
  1. cognite_toolkit/_cdf.py +21 -23
  2. cognite_toolkit/_cdf_tk/apps/__init__.py +4 -0
  3. cognite_toolkit/_cdf_tk/apps/_core_app.py +19 -5
  4. cognite_toolkit/_cdf_tk/apps/_data_app.py +1 -1
  5. cognite_toolkit/_cdf_tk/apps/_dev_app.py +86 -0
  6. cognite_toolkit/_cdf_tk/apps/_download_app.py +693 -25
  7. cognite_toolkit/_cdf_tk/apps/_dump_app.py +44 -102
  8. cognite_toolkit/_cdf_tk/apps/_import_app.py +41 -0
  9. cognite_toolkit/_cdf_tk/apps/_landing_app.py +18 -4
  10. cognite_toolkit/_cdf_tk/apps/_migrate_app.py +424 -9
  11. cognite_toolkit/_cdf_tk/apps/_modules_app.py +0 -3
  12. cognite_toolkit/_cdf_tk/apps/_purge.py +15 -43
  13. cognite_toolkit/_cdf_tk/apps/_run.py +11 -0
  14. cognite_toolkit/_cdf_tk/apps/_upload_app.py +45 -6
  15. cognite_toolkit/_cdf_tk/builders/__init__.py +2 -2
  16. cognite_toolkit/_cdf_tk/builders/_base.py +28 -42
  17. cognite_toolkit/_cdf_tk/builders/_raw.py +1 -1
  18. cognite_toolkit/_cdf_tk/cdf_toml.py +20 -1
  19. cognite_toolkit/_cdf_tk/client/_toolkit_client.py +32 -12
  20. cognite_toolkit/_cdf_tk/client/api/infield.py +114 -17
  21. cognite_toolkit/_cdf_tk/client/api/{canvas.py → legacy/canvas.py} +15 -7
  22. cognite_toolkit/_cdf_tk/client/api/{charts.py → legacy/charts.py} +1 -1
  23. cognite_toolkit/_cdf_tk/client/api/{extended_data_modeling.py → legacy/extended_data_modeling.py} +1 -1
  24. cognite_toolkit/_cdf_tk/client/api/{extended_files.py → legacy/extended_files.py} +2 -2
  25. cognite_toolkit/_cdf_tk/client/api/{extended_functions.py → legacy/extended_functions.py} +15 -18
  26. cognite_toolkit/_cdf_tk/client/api/{extended_raw.py → legacy/extended_raw.py} +1 -1
  27. cognite_toolkit/_cdf_tk/client/api/{extended_timeseries.py → legacy/extended_timeseries.py} +5 -2
  28. cognite_toolkit/_cdf_tk/client/api/{location_filters.py → legacy/location_filters.py} +1 -1
  29. cognite_toolkit/_cdf_tk/client/api/legacy/robotics/__init__.py +8 -0
  30. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/capabilities.py +1 -1
  31. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/data_postprocessing.py +1 -1
  32. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/frames.py +1 -1
  33. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/locations.py +1 -1
  34. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/maps.py +1 -1
  35. cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/robots.py +2 -2
  36. cognite_toolkit/_cdf_tk/client/api/{search_config.py → legacy/search_config.py} +5 -1
  37. cognite_toolkit/_cdf_tk/client/api/migration.py +177 -4
  38. cognite_toolkit/_cdf_tk/client/api/project.py +9 -8
  39. cognite_toolkit/_cdf_tk/client/api/search.py +2 -2
  40. cognite_toolkit/_cdf_tk/client/api/streams.py +88 -0
  41. cognite_toolkit/_cdf_tk/client/api/three_d.py +384 -0
  42. cognite_toolkit/_cdf_tk/client/data_classes/api_classes.py +13 -0
  43. cognite_toolkit/_cdf_tk/client/data_classes/base.py +37 -33
  44. cognite_toolkit/_cdf_tk/client/data_classes/charts_data.py +95 -213
  45. cognite_toolkit/_cdf_tk/client/data_classes/infield.py +32 -18
  46. cognite_toolkit/_cdf_tk/client/data_classes/instance_api.py +18 -13
  47. cognite_toolkit/_cdf_tk/client/data_classes/legacy/__init__.py +0 -0
  48. cognite_toolkit/_cdf_tk/client/data_classes/{canvas.py → legacy/canvas.py} +47 -4
  49. cognite_toolkit/_cdf_tk/client/data_classes/{charts.py → legacy/charts.py} +3 -3
  50. cognite_toolkit/_cdf_tk/client/data_classes/{migration.py → legacy/migration.py} +10 -2
  51. cognite_toolkit/_cdf_tk/client/data_classes/streams.py +90 -0
  52. cognite_toolkit/_cdf_tk/client/data_classes/three_d.py +112 -0
  53. cognite_toolkit/_cdf_tk/client/testing.py +42 -18
  54. cognite_toolkit/_cdf_tk/commands/__init__.py +7 -6
  55. cognite_toolkit/_cdf_tk/commands/_changes.py +3 -42
  56. cognite_toolkit/_cdf_tk/commands/_download.py +21 -11
  57. cognite_toolkit/_cdf_tk/commands/_migrate/__init__.py +0 -2
  58. cognite_toolkit/_cdf_tk/commands/_migrate/command.py +22 -20
  59. cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py +140 -92
  60. cognite_toolkit/_cdf_tk/commands/_migrate/creators.py +1 -1
  61. cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py +108 -26
  62. cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py +448 -45
  63. cognite_toolkit/_cdf_tk/commands/_migrate/data_model.py +1 -0
  64. cognite_toolkit/_cdf_tk/commands/_migrate/default_mappings.py +6 -6
  65. cognite_toolkit/_cdf_tk/commands/_migrate/issues.py +52 -1
  66. cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py +377 -11
  67. cognite_toolkit/_cdf_tk/commands/_migrate/selectors.py +9 -4
  68. cognite_toolkit/_cdf_tk/commands/_profile.py +1 -1
  69. cognite_toolkit/_cdf_tk/commands/_purge.py +36 -39
  70. cognite_toolkit/_cdf_tk/commands/_questionary_style.py +16 -0
  71. cognite_toolkit/_cdf_tk/commands/_upload.py +109 -86
  72. cognite_toolkit/_cdf_tk/commands/about.py +221 -0
  73. cognite_toolkit/_cdf_tk/commands/auth.py +19 -12
  74. cognite_toolkit/_cdf_tk/commands/build_cmd.py +16 -62
  75. cognite_toolkit/_cdf_tk/commands/build_v2/__init__.py +0 -0
  76. cognite_toolkit/_cdf_tk/commands/build_v2/build_cmd.py +241 -0
  77. cognite_toolkit/_cdf_tk/commands/build_v2/build_input.py +85 -0
  78. cognite_toolkit/_cdf_tk/commands/build_v2/build_issues.py +27 -0
  79. cognite_toolkit/_cdf_tk/commands/clean.py +63 -16
  80. cognite_toolkit/_cdf_tk/commands/deploy.py +20 -17
  81. cognite_toolkit/_cdf_tk/commands/dump_resource.py +10 -8
  82. cognite_toolkit/_cdf_tk/commands/init.py +225 -3
  83. cognite_toolkit/_cdf_tk/commands/modules.py +20 -44
  84. cognite_toolkit/_cdf_tk/commands/pull.py +6 -19
  85. cognite_toolkit/_cdf_tk/commands/resources.py +179 -0
  86. cognite_toolkit/_cdf_tk/commands/run.py +1 -1
  87. cognite_toolkit/_cdf_tk/constants.py +20 -1
  88. cognite_toolkit/_cdf_tk/cruds/__init__.py +19 -5
  89. cognite_toolkit/_cdf_tk/cruds/_base_cruds.py +14 -70
  90. cognite_toolkit/_cdf_tk/cruds/_data_cruds.py +10 -19
  91. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/__init__.py +4 -1
  92. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/agent.py +11 -9
  93. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/auth.py +5 -15
  94. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/classic.py +45 -44
  95. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/configuration.py +5 -12
  96. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/data_organization.py +4 -13
  97. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py +206 -67
  98. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py +6 -18
  99. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py +126 -35
  100. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py +7 -28
  101. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py +23 -30
  102. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/hosted_extractors.py +12 -30
  103. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/industrial_tool.py +4 -8
  104. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/location.py +4 -16
  105. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/migration.py +5 -13
  106. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/raw.py +5 -11
  107. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/relationship.py +3 -8
  108. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/robotics.py +16 -45
  109. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/streams.py +94 -0
  110. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/three_d_model.py +3 -7
  111. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/timeseries.py +5 -15
  112. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/transformation.py +75 -32
  113. cognite_toolkit/_cdf_tk/cruds/_resource_cruds/workflow.py +20 -40
  114. cognite_toolkit/_cdf_tk/cruds/_worker.py +24 -36
  115. cognite_toolkit/_cdf_tk/data_classes/_module_toml.py +1 -0
  116. cognite_toolkit/_cdf_tk/feature_flags.py +16 -36
  117. cognite_toolkit/_cdf_tk/plugins.py +2 -1
  118. cognite_toolkit/_cdf_tk/resource_classes/__init__.py +4 -0
  119. cognite_toolkit/_cdf_tk/resource_classes/capabilities.py +12 -0
  120. cognite_toolkit/_cdf_tk/resource_classes/functions.py +3 -1
  121. cognite_toolkit/_cdf_tk/resource_classes/infield_cdm_location_config.py +109 -0
  122. cognite_toolkit/_cdf_tk/resource_classes/migration.py +8 -17
  123. cognite_toolkit/_cdf_tk/resource_classes/search_config.py +1 -1
  124. cognite_toolkit/_cdf_tk/resource_classes/streams.py +29 -0
  125. cognite_toolkit/_cdf_tk/resource_classes/workflow_version.py +164 -5
  126. cognite_toolkit/_cdf_tk/storageio/__init__.py +9 -21
  127. cognite_toolkit/_cdf_tk/storageio/_annotations.py +19 -16
  128. cognite_toolkit/_cdf_tk/storageio/_applications.py +340 -28
  129. cognite_toolkit/_cdf_tk/storageio/_asset_centric.py +67 -104
  130. cognite_toolkit/_cdf_tk/storageio/_base.py +61 -29
  131. cognite_toolkit/_cdf_tk/storageio/_datapoints.py +276 -20
  132. cognite_toolkit/_cdf_tk/storageio/_file_content.py +435 -0
  133. cognite_toolkit/_cdf_tk/storageio/_instances.py +35 -3
  134. cognite_toolkit/_cdf_tk/storageio/_raw.py +26 -0
  135. cognite_toolkit/_cdf_tk/storageio/selectors/__init__.py +71 -4
  136. cognite_toolkit/_cdf_tk/storageio/selectors/_base.py +14 -2
  137. cognite_toolkit/_cdf_tk/storageio/selectors/_canvas.py +14 -0
  138. cognite_toolkit/_cdf_tk/storageio/selectors/_charts.py +14 -0
  139. cognite_toolkit/_cdf_tk/storageio/selectors/_datapoints.py +23 -3
  140. cognite_toolkit/_cdf_tk/storageio/selectors/_file_content.py +164 -0
  141. cognite_toolkit/_cdf_tk/storageio/selectors/_three_d.py +34 -0
  142. cognite_toolkit/_cdf_tk/tk_warnings/other.py +4 -0
  143. cognite_toolkit/_cdf_tk/tracker.py +2 -2
  144. cognite_toolkit/_cdf_tk/utils/cdf.py +1 -1
  145. cognite_toolkit/_cdf_tk/utils/dtype_conversion.py +9 -3
  146. cognite_toolkit/_cdf_tk/utils/fileio/__init__.py +2 -0
  147. cognite_toolkit/_cdf_tk/utils/fileio/_base.py +5 -1
  148. cognite_toolkit/_cdf_tk/utils/fileio/_readers.py +112 -20
  149. cognite_toolkit/_cdf_tk/utils/fileio/_writers.py +15 -15
  150. cognite_toolkit/_cdf_tk/utils/http_client/__init__.py +28 -0
  151. cognite_toolkit/_cdf_tk/utils/http_client/_client.py +285 -18
  152. cognite_toolkit/_cdf_tk/utils/http_client/_data_classes.py +56 -4
  153. cognite_toolkit/_cdf_tk/utils/http_client/_data_classes2.py +247 -0
  154. cognite_toolkit/_cdf_tk/utils/http_client/_tracker.py +5 -2
  155. cognite_toolkit/_cdf_tk/utils/interactive_select.py +60 -18
  156. cognite_toolkit/_cdf_tk/utils/sql_parser.py +2 -3
  157. cognite_toolkit/_cdf_tk/utils/useful_types.py +6 -2
  158. cognite_toolkit/_cdf_tk/validation.py +83 -1
  159. cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml +1 -1
  160. cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml +1 -1
  161. cognite_toolkit/_resources/cdf.toml +5 -4
  162. cognite_toolkit/_version.py +1 -1
  163. cognite_toolkit/config.dev.yaml +13 -0
  164. {cognite_toolkit-0.6.97.dist-info → cognite_toolkit-0.7.39.dist-info}/METADATA +24 -24
  165. cognite_toolkit-0.7.39.dist-info/RECORD +322 -0
  166. cognite_toolkit-0.7.39.dist-info/WHEEL +4 -0
  167. {cognite_toolkit-0.6.97.dist-info → cognite_toolkit-0.7.39.dist-info}/entry_points.txt +1 -0
  168. cognite_toolkit/_cdf_tk/client/api/robotics/__init__.py +0 -3
  169. cognite_toolkit/_cdf_tk/commands/_migrate/canvas.py +0 -201
  170. cognite_toolkit/_cdf_tk/commands/dump_data.py +0 -489
  171. cognite_toolkit/_cdf_tk/commands/featureflag.py +0 -27
  172. cognite_toolkit/_cdf_tk/prototypes/import_app.py +0 -41
  173. cognite_toolkit/_cdf_tk/utils/table_writers.py +0 -434
  174. cognite_toolkit-0.6.97.dist-info/RECORD +0 -306
  175. cognite_toolkit-0.6.97.dist-info/WHEEL +0 -4
  176. cognite_toolkit-0.6.97.dist-info/licenses/LICENSE +0 -18
  177. /cognite_toolkit/_cdf_tk/{prototypes/commands → client/api/legacy}/__init__.py +0 -0
  178. /cognite_toolkit/_cdf_tk/client/api/{dml.py → legacy/dml.py} +0 -0
  179. /cognite_toolkit/_cdf_tk/client/api/{fixed_transformations.py → legacy/fixed_transformations.py} +0 -0
  180. /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/api.py +0 -0
  181. /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/utlis.py +0 -0
  182. /cognite_toolkit/_cdf_tk/client/data_classes/{apm_config_v1.py → legacy/apm_config_v1.py} +0 -0
  183. /cognite_toolkit/_cdf_tk/client/data_classes/{extendable_cognite_file.py → legacy/extendable_cognite_file.py} +0 -0
  184. /cognite_toolkit/_cdf_tk/client/data_classes/{extended_filemetadata.py → legacy/extended_filemetadata.py} +0 -0
  185. /cognite_toolkit/_cdf_tk/client/data_classes/{extended_filemetdata.py → legacy/extended_filemetdata.py} +0 -0
  186. /cognite_toolkit/_cdf_tk/client/data_classes/{extended_timeseries.py → legacy/extended_timeseries.py} +0 -0
  187. /cognite_toolkit/_cdf_tk/client/data_classes/{functions.py → legacy/functions.py} +0 -0
  188. /cognite_toolkit/_cdf_tk/client/data_classes/{graphql_data_models.py → legacy/graphql_data_models.py} +0 -0
  189. /cognite_toolkit/_cdf_tk/client/data_classes/{instances.py → legacy/instances.py} +0 -0
  190. /cognite_toolkit/_cdf_tk/client/data_classes/{location_filters.py → legacy/location_filters.py} +0 -0
  191. /cognite_toolkit/_cdf_tk/client/data_classes/{pending_instances_ids.py → legacy/pending_instances_ids.py} +0 -0
  192. /cognite_toolkit/_cdf_tk/client/data_classes/{project.py → legacy/project.py} +0 -0
  193. /cognite_toolkit/_cdf_tk/client/data_classes/{raw.py → legacy/raw.py} +0 -0
  194. /cognite_toolkit/_cdf_tk/client/data_classes/{robotics.py → legacy/robotics.py} +0 -0
  195. /cognite_toolkit/_cdf_tk/client/data_classes/{search_config.py → legacy/search_config.py} +0 -0
  196. /cognite_toolkit/_cdf_tk/client/data_classes/{sequences.py → legacy/sequences.py} +0 -0
  197. /cognite_toolkit/_cdf_tk/client/data_classes/{streamlit_.py → legacy/streamlit_.py} +0 -0
  198. /cognite_toolkit/_cdf_tk/{prototypes/commands/import_.py → commands/_import_cmd.py} +0 -0
@@ -6,14 +6,8 @@ from cognite.client.data_classes import WorkflowVersionId
6
6
  from cognite.client.data_classes.data_modeling import DataModelId, ViewId
7
7
  from rich import print
8
8
 
9
- from cognite_toolkit._cdf_tk.client.data_classes.search_config import ViewId as SearchConfigViewId
10
- from cognite_toolkit._cdf_tk.commands import DumpDataCommand, DumpResourceCommand
11
- from cognite_toolkit._cdf_tk.commands.dump_data import (
12
- AssetFinder,
13
- EventFinder,
14
- FileMetadataFinder,
15
- TimeSeriesFinder,
16
- )
9
+ from cognite_toolkit._cdf_tk.client.data_classes.legacy.search_config import ViewId as SearchConfigViewId
10
+ from cognite_toolkit._cdf_tk.commands import DumpResourceCommand
17
11
  from cognite_toolkit._cdf_tk.commands.dump_resource import (
18
12
  AgentFinder,
19
13
  DataModelFinder,
@@ -32,45 +26,32 @@ from cognite_toolkit._cdf_tk.commands.dump_resource import (
32
26
  from cognite_toolkit._cdf_tk.exceptions import ToolkitRequiredValueError
33
27
  from cognite_toolkit._cdf_tk.feature_flags import Flags
34
28
  from cognite_toolkit._cdf_tk.utils.auth import EnvironmentVariables
35
- from cognite_toolkit._cdf_tk.utils.interactive_select import (
36
- AssetInteractiveSelect,
37
- EventInteractiveSelect,
38
- FileMetadataInteractiveSelect,
39
- TimeSeriesInteractiveSelect,
40
- )
41
29
 
42
30
 
43
31
  class DumpApp(typer.Typer):
44
32
  def __init__(self, *args: Any, **kwargs: Any) -> None:
45
33
  super().__init__(*args, **kwargs)
46
34
  self.callback(invoke_without_command=True)(self.dump_main)
47
- if Flags.DUMP_DATA.is_enabled():
48
- self.add_typer(DumpDataApp(*args, **kwargs), name="data")
49
- self.add_typer(DumpConfigApp(*args, **kwargs), name="config")
50
- else:
51
- self.command("datamodel")(DumpConfigApp.dump_datamodel_cmd)
35
+ self.command("datamodel")(DumpConfigApp.dump_datamodel_cmd)
52
36
 
53
- self.command("asset")(DumpDataApp.dump_asset_cmd)
54
- self.command("timeseries")(DumpDataApp.dump_timeseries_cmd)
37
+ self.command("asset")(DumpDataApp.dump_asset_cmd)
38
+ self.command("timeseries")(DumpDataApp.dump_timeseries_cmd)
55
39
 
56
- self.command("workflow")(DumpConfigApp.dump_workflow)
57
- self.command("transformation")(DumpConfigApp.dump_transformation)
58
- self.command("group")(DumpConfigApp.dump_group)
59
- self.command("node")(DumpConfigApp.dump_node)
60
- self.command("spaces")(DumpConfigApp.dump_spaces)
40
+ self.command("workflow")(DumpConfigApp.dump_workflow)
41
+ self.command("transformation")(DumpConfigApp.dump_transformation)
42
+ self.command("group")(DumpConfigApp.dump_group)
43
+ self.command("node")(DumpConfigApp.dump_node)
44
+ self.command("spaces")(DumpConfigApp.dump_spaces)
61
45
 
62
- if Flags.DUMP_EXTENDED.is_enabled():
63
- self.command("location-filter")(DumpConfigApp.dump_location_filters)
64
- self.command("extraction-pipeline")(DumpConfigApp.dump_extraction_pipeline)
65
- self.command("functions")(DumpConfigApp.dump_functions)
66
- self.command("datasets")(DumpConfigApp.dump_datasets)
67
- self.command("streamlit")(DumpConfigApp.dump_streamlit)
46
+ self.command("location-filter")(DumpConfigApp.dump_location_filters)
47
+ self.command("extraction-pipeline")(DumpConfigApp.dump_extraction_pipeline)
48
+ self.command("functions")(DumpConfigApp.dump_functions)
49
+ self.command("datasets")(DumpConfigApp.dump_datasets)
50
+ self.command("streamlit")(DumpConfigApp.dump_streamlit)
68
51
 
69
- if Flags.AGENTS.is_enabled():
70
- self.command("agents")(DumpConfigApp.dump_agents)
52
+ self.command("agents")(DumpConfigApp.dump_agents)
71
53
 
72
- if Flags.SEARCH_CONFIG.is_enabled():
73
- self.command("search-config")(DumpConfigApp.dump_search_config)
54
+ self.command("search-config")(DumpConfigApp.dump_search_config)
74
55
 
75
56
  @staticmethod
76
57
  def dump_main(ctx: typer.Context) -> None:
@@ -91,18 +72,13 @@ class DumpConfigApp(typer.Typer):
91
72
  self.command("group")(self.dump_group)
92
73
  self.command("node")(self.dump_node)
93
74
  self.command("spaces")(self.dump_spaces)
94
- if Flags.DUMP_EXTENDED.is_enabled():
95
- self.command("location-filters")(self.dump_location_filters)
96
- self.command("extraction-pipeline")(self.dump_extraction_pipeline)
97
- self.command("datasets")(DumpConfigApp.dump_datasets)
98
- self.command("functions")(self.dump_functions)
99
- self.command("streamlit")(DumpConfigApp.dump_streamlit)
100
-
101
- if Flags.AGENTS.is_enabled():
102
- self.command("agents")(self.dump_agents)
103
-
104
- if Flags.SEARCH_CONFIG.is_enabled():
105
- self.command("search-config")(self.dump_search_config)
75
+ self.command("location-filters")(self.dump_location_filters)
76
+ self.command("extraction-pipeline")(self.dump_extraction_pipeline)
77
+ self.command("datasets")(DumpConfigApp.dump_datasets)
78
+ self.command("functions")(self.dump_functions)
79
+ self.command("streamlit")(DumpConfigApp.dump_streamlit)
80
+ self.command("agents")(self.dump_agents)
81
+ self.command("search-config")(self.dump_search_config)
106
82
 
107
83
  @staticmethod
108
84
  def dump_config_main(ctx: typer.Context) -> None:
@@ -862,21 +838,11 @@ class DumpDataApp(typer.Typer):
862
838
  ] = False,
863
839
  ) -> None:
864
840
  """This command will dump the selected assets in the selected format to the folder specified, defaults to /tmp."""
865
- cmd = DumpDataCommand()
866
- client = EnvironmentVariables.create_from_environment().get_client()
867
- if hierarchy is None and data_set is None:
868
- hierarchy, data_set = AssetInteractiveSelect(client, "dump").select_hierarchies_and_data_sets()
869
-
870
- cmd.run(
871
- lambda: cmd.dump_table(
872
- AssetFinder(client, hierarchy or [], data_set or []),
873
- output_dir,
874
- clean,
875
- limit,
876
- format_,
877
- verbose,
841
+ if Flags.v08:
842
+ raise ValueError(
843
+ "The `cdf dump data asset` command has been removed. Please use `cdf data download assets` instead."
878
844
  )
879
- )
845
+ print("[bold yellow]Warning:[/] This command has been removed. Please use `cdf data download assets` instead.")
880
846
 
881
847
  @staticmethod
882
848
  def dump_files_cmd(
@@ -940,21 +906,12 @@ class DumpDataApp(typer.Typer):
940
906
  ] = False,
941
907
  ) -> None:
942
908
  """This command will dump the selected events to the selected format in the folder specified, defaults to /tmp."""
943
- cmd = DumpDataCommand()
944
- cmd.validate_directory(output_dir, clean)
945
- client = EnvironmentVariables.create_from_environment().get_client()
946
- if hierarchy is None and data_set is None:
947
- hierarchy, data_set = FileMetadataInteractiveSelect(client, "dump").select_hierarchies_and_data_sets()
948
- cmd.run(
949
- lambda: cmd.dump_table(
950
- FileMetadataFinder(client, hierarchy or [], data_set or []),
951
- output_dir,
952
- clean,
953
- limit,
954
- format_,
955
- verbose,
909
+ if Flags.v08:
910
+ raise ValueError(
911
+ "The `cdf dump data files-metadata` command has been removed. Please use `cdf data download files` instead."
956
912
  )
957
- )
913
+ print("[bold yellow]Warning:[/] This command has been removed. Please use `cdf data download files` instead.")
914
+ return None
958
915
 
959
916
  @staticmethod
960
917
  def dump_timeseries_cmd(
@@ -1018,20 +975,14 @@ class DumpDataApp(typer.Typer):
1018
975
  ] = False,
1019
976
  ) -> None:
1020
977
  """This command will dump the selected timeseries to the selected format in the folder specified, defaults to /tmp."""
1021
- cmd = DumpDataCommand()
1022
- client = EnvironmentVariables.create_from_environment().get_client()
1023
- if hierarchy is None and data_set is None:
1024
- hierarchy, data_set = TimeSeriesInteractiveSelect(client, "dump").select_hierarchies_and_data_sets()
1025
- cmd.run(
1026
- lambda: cmd.dump_table(
1027
- TimeSeriesFinder(client, hierarchy or [], data_set or []),
1028
- output_dir,
1029
- clean,
1030
- limit,
1031
- format_,
1032
- verbose,
978
+ if Flags.v08:
979
+ raise ValueError(
980
+ "The `cdf dump data timeseries` command has been removed. Please use `cdf data download timeseries` instead."
1033
981
  )
982
+ print(
983
+ "[bold yellow]Warning:[/] This command has been removed. Please use `cdf data download timeseries` instead."
1034
984
  )
985
+ return None
1035
986
 
1036
987
  @staticmethod
1037
988
  def dump_event_cmd(
@@ -1095,18 +1046,9 @@ class DumpDataApp(typer.Typer):
1095
1046
  ] = False,
1096
1047
  ) -> None:
1097
1048
  """This command will dump the selected events to the selected format in the folder specified, defaults to /tmp."""
1098
- cmd = DumpDataCommand()
1099
- cmd.validate_directory(output_dir, clean)
1100
- client = EnvironmentVariables.create_from_environment().get_client()
1101
- if hierarchy is None and data_set is None:
1102
- hierarchy, data_set = EventInteractiveSelect(client, "dump").select_hierarchies_and_data_sets()
1103
- cmd.run(
1104
- lambda: cmd.dump_table(
1105
- EventFinder(client, hierarchy or [], data_set or []),
1106
- output_dir,
1107
- clean,
1108
- limit,
1109
- format_,
1110
- verbose,
1049
+ if Flags.v08:
1050
+ raise ValueError(
1051
+ "The `cdf dump data event` command has been removed. Please use `cdf data download events` instead."
1111
1052
  )
1112
- )
1053
+ print("[bold yellow]Warning:[/] This command has been removed. Please use `cdf data download events` instead.")
1054
+ return None
@@ -0,0 +1,41 @@
1
+ from pathlib import Path
2
+ from typing import Any
3
+
4
+ import typer
5
+
6
+ from cognite_toolkit._cdf_tk.client import ToolkitClient
7
+ from cognite_toolkit._cdf_tk.commands._import_cmd import ImportTransformationCLI
8
+ from cognite_toolkit._cdf_tk.utils.auth import EnvironmentVariables
9
+
10
+
11
+ class ImportApp(typer.Typer):
12
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
13
+ super().__init__(*args, **kwargs)
14
+ self.callback(invoke_without_command=True)(self.main)
15
+ self.command("transformation-cli")(self.transformation_cli)
16
+
17
+ def main(self, ctx: typer.Context) -> None:
18
+ """PREVIEW FEATURE Import resources into Cognite-Toolkit."""
19
+ if ctx.invoked_subcommand is None:
20
+ print("Use [bold yellow]cdf-tk import --help[/] for more information.")
21
+ return None
22
+
23
+ @staticmethod
24
+ def transformation_cli(
25
+ source: Path = typer.Argument(..., help="Path to the transformation CLI manifest directory or files."),
26
+ destination: Path = typer.Argument(..., help="Path to the destination directory."),
27
+ overwrite: bool = typer.Option(False, help="Overwrite destination if it already exists."),
28
+ flatten: bool = typer.Option(False, help="Flatten the directory structure."),
29
+ clean: bool = typer.Option(False, help="Remove the source directory after import."),
30
+ verbose: bool = typer.Option(False, help="Turn on to get more verbose output when running the command"),
31
+ ) -> None:
32
+ """Import transformation CLI manifests into Cognite-Toolkit modules."""
33
+
34
+ # We are lazy loading the client as we only need it if we need to look up dataset ids.
35
+ # This is to ensure the command can be executed without a client if the user does not need to look up dataset ids.
36
+ # (which is likely 99% of the time)
37
+ def get_client() -> ToolkitClient:
38
+ return EnvironmentVariables.create_from_environment().get_client()
39
+
40
+ cmd = ImportTransformationCLI(print_warning=True, get_client=get_client)
41
+ cmd.execute(source, destination, overwrite, flatten, clean, verbose=verbose)
@@ -1,3 +1,5 @@
1
+ from typing import Annotated
2
+
1
3
  import typer
2
4
 
3
5
  from cognite_toolkit._cdf_tk.commands import InitCommand
@@ -6,9 +8,21 @@ from cognite_toolkit._cdf_tk.commands import InitCommand
6
8
  class LandingApp(typer.Typer):
7
9
  def __init__(self, *args, **kwargs) -> None: # type: ignore
8
10
  super().__init__(*args, **kwargs)
9
- self.command()(self.main_init)
10
11
 
11
- def main_init(self) -> None:
12
- """Guidance on how to get started"""
12
+ def main_init(
13
+ self,
14
+ dry_run: Annotated[
15
+ bool,
16
+ typer.Option(
17
+ "--dry-run",
18
+ "-r",
19
+ help="Whether to do a dry-run, do dry-run if present.",
20
+ ),
21
+ ] = False,
22
+ ) -> None:
23
+ """Getting started checklist"""
13
24
  cmd = InitCommand()
14
- cmd.run(cmd.execute)
25
+ # Tracking command with the usual lambda run construct
26
+ # is intentionally left out because we don't want to expose the user to the warning
27
+ # before they've had the chance to opt in (which is something they'll do later using this command).
28
+ cmd.execute(dry_run=dry_run)