osducli 0.0.47__tar.gz → 0.0.48__tar.gz

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 (145) hide show
  1. {osducli-0.0.47/src/osducli.egg-info → osducli-0.0.48}/PKG-INFO +10 -8
  2. {osducli-0.0.47 → osducli-0.0.48}/README.rst +8 -7
  3. {osducli-0.0.47 → osducli-0.0.48}/pyproject.toml +5 -1
  4. osducli-0.0.48/src/osducli/VERSION +1 -0
  5. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/consts.py +1 -0
  6. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/update.py +10 -0
  7. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/add.py +0 -2
  8. osducli-0.0.48/src/osducli/commands/wbdutil/__init__.py +13 -0
  9. osducli-0.0.48/src/osducli/commands/wbdutil/_const.py +16 -0
  10. osducli-0.0.48/src/osducli/commands/wbdutil/config_file.py +40 -0
  11. osducli-0.0.48/src/osducli/commands/wbdutil/download.py +38 -0
  12. osducli-0.0.48/src/osducli/commands/wbdutil/ingest/__init__.py +13 -0
  13. osducli-0.0.48/src/osducli/commands/wbdutil/ingest/data.py +37 -0
  14. osducli-0.0.48/src/osducli/commands/wbdutil/ingest/wellbore.py +37 -0
  15. osducli-0.0.48/src/osducli/commands/wbdutil/list/__init__.py +13 -0
  16. osducli-0.0.48/src/osducli/commands/wbdutil/list/curves.py +38 -0
  17. osducli-0.0.48/src/osducli/commands/wbdutil/list/wellbore.py +38 -0
  18. osducli-0.0.48/src/osducli/commands/wbdutil/list/welllog.py +38 -0
  19. osducli-0.0.48/src/osducli/commands/wbdutil/parse/__init__.py +13 -0
  20. osducli-0.0.48/src/osducli/commands/wbdutil/parse/convert.py +35 -0
  21. osducli-0.0.48/src/osducli/commands/wbdutil/parse/print.py +27 -0
  22. osducli-0.0.48/src/osducli/commands/wbdutil/search.py +36 -0
  23. osducli-0.0.48/src/osducli/commands/wbdutil/update.py +37 -0
  24. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/config.py +1 -0
  25. {osducli-0.0.47 → osducli-0.0.48/src/osducli.egg-info}/PKG-INFO +10 -8
  26. {osducli-0.0.47 → osducli-0.0.48}/src/osducli.egg-info/SOURCES.txt +16 -0
  27. {osducli-0.0.47 → osducli-0.0.48}/src/osducli.egg-info/requires.txt +1 -0
  28. {osducli-0.0.47 → osducli-0.0.48}/tests/test_help_text.py +1 -0
  29. osducli-0.0.47/src/osducli/VERSION +0 -1
  30. {osducli-0.0.47 → osducli-0.0.48}/LICENSE.md +0 -0
  31. {osducli-0.0.47 → osducli-0.0.48}/MANIFEST.in +0 -0
  32. {osducli-0.0.47 → osducli-0.0.48}/setup.cfg +0 -0
  33. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/__init__.py +0 -0
  34. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/__main__.py +0 -0
  35. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/__init__.py +0 -0
  36. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/aws_token_credential.py +0 -0
  37. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/credentials.py +0 -0
  38. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/msal_interactive.py +0 -0
  39. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/msal_non_interactive.py +0 -0
  40. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/auth/token_credential.py +0 -0
  41. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/click_cli.py +0 -0
  42. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/cliclient.py +0 -0
  43. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/__init__.py +0 -0
  44. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/__init__.py +0 -0
  45. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/default.py +0 -0
  46. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/info.py +0 -0
  47. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/config/list.py +0 -0
  48. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/__init__.py +0 -0
  49. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/_const.py +0 -0
  50. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/areas.py +0 -0
  51. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/info.py +0 -0
  52. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/list.py +0 -0
  53. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/summary.py +0 -0
  54. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/crs/transforms.py +0 -0
  55. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/dataload/__init__.py +0 -0
  56. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/dataload/checkrefs.py +0 -0
  57. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/dataload/ingest.py +0 -0
  58. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/dataload/status.py +0 -0
  59. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/dataload/verify.py +0 -0
  60. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/__init__.py +0 -0
  61. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/_const.py +0 -0
  62. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/groups/__init__.py +0 -0
  63. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/groups/add.py +0 -0
  64. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/groups/delete.py +0 -0
  65. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/groups/members.py +0 -0
  66. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/info.py +0 -0
  67. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/members/__init__.py +0 -0
  68. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/members/add.py +0 -0
  69. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/members/groups.py +0 -0
  70. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/members/list.py +0 -0
  71. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/members/remove.py +0 -0
  72. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/entitlements/mygroups.py +0 -0
  73. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/file/__init__.py +0 -0
  74. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/file/_const.py +0 -0
  75. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/file/download.py +0 -0
  76. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/file/info.py +0 -0
  77. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/file/metadata.py +0 -0
  78. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/__init__.py +0 -0
  79. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/_const.py +0 -0
  80. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/add.py +0 -0
  81. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/delete.py +0 -0
  82. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/info.py +0 -0
  83. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/legal/listtags.py +0 -0
  84. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/list/__init__.py +0 -0
  85. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/list/records.py +0 -0
  86. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/__init__.py +0 -0
  87. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/_const.py +0 -0
  88. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/add.py +0 -0
  89. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/get.py +0 -0
  90. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/info.py +0 -0
  91. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/schema/list.py +0 -0
  92. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/__init__.py +0 -0
  93. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/_const.py +0 -0
  94. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/id.py +0 -0
  95. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/info.py +0 -0
  96. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/kind.py +0 -0
  97. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/search/query.py +0 -0
  98. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/status/__init__.py +0 -0
  99. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/status/status.py +0 -0
  100. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/__init__.py +0 -0
  101. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/_const.py +0 -0
  102. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/delete.py +0 -0
  103. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/get.py +0 -0
  104. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/info.py +0 -0
  105. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/list.py +0 -0
  106. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/storage/versions.py +0 -0
  107. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/unit/__init__.py +0 -0
  108. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/unit/_const.py +0 -0
  109. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/unit/info.py +0 -0
  110. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/unit/list.py +0 -0
  111. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/version/__init__.py +0 -0
  112. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/version/version.py +0 -0
  113. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/__init__.py +0 -0
  114. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/_const.py +0 -0
  115. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/info.py +0 -0
  116. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/__init__.py +0 -0
  117. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/add.py +0 -0
  118. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/data/__init__.py +0 -0
  119. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/data/add.py +0 -0
  120. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/data/get.py +0 -0
  121. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/wellbore_ddms/well_log/get.py +0 -0
  122. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/__init__.py +0 -0
  123. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/_const.py +0 -0
  124. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/get.py +0 -0
  125. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/info.py +0 -0
  126. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/list.py +0 -0
  127. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/register.py +0 -0
  128. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/runs.py +0 -0
  129. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/status.py +0 -0
  130. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/commands/workflow/unregister.py +0 -0
  131. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/log.py +0 -0
  132. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/state.py +0 -0
  133. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/__init__.py +0 -0
  134. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/exceptions.py +0 -0
  135. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/file.py +0 -0
  136. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/prompt.py +0 -0
  137. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/pypi.py +0 -0
  138. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/util/service_info.py +0 -0
  139. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/version.py +0 -0
  140. {osducli-0.0.47 → osducli-0.0.48}/src/osducli/wbddms_client.py +0 -0
  141. {osducli-0.0.47 → osducli-0.0.48}/src/osducli.egg-info/dependency_links.txt +0 -0
  142. {osducli-0.0.47 → osducli-0.0.48}/src/osducli.egg-info/entry_points.txt +0 -0
  143. {osducli-0.0.47 → osducli-0.0.48}/src/osducli.egg-info/top_level.txt +0 -0
  144. {osducli-0.0.47 → osducli-0.0.48}/tests/test_click_cli_state.py +0 -0
  145. {osducli-0.0.47 → osducli-0.0.48}/tests/test_cliclient.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osducli
3
- Version: 0.0.47
3
+ Version: 0.0.48
4
4
  Summary: OSDU command line
5
5
  Author-email: Equinor ASA <mhew@equinor.com>
6
6
  License-Expression: Apache-2.0
@@ -20,6 +20,7 @@ Requires-Dist: osdu-api[common]==1.0.3
20
20
  Requires-Dist: requests
21
21
  Requires-Dist: tabulate
22
22
  Requires-Dist: packaging
23
+ Requires-Dist: wbdutil==0.1.1
23
24
  Requires-Dist: msal
24
25
  Requires-Dist: msal-extensions
25
26
  Requires-Dist: azure-identity
@@ -49,13 +50,6 @@ OSDU Command Line Interface
49
50
 
50
51
  Command-line interface for interacting with OSDU.
51
52
 
52
- NOTE: With version 0.0.45 and earlier the pip install command may need extra parameter since a dependency is not available from pypi.org:
53
-
54
- .. code-block:: bash
55
-
56
- pip install osducli --extra-index-url=https://community.opengroup.org/api/v4/projects/148/packages/pypi/simple
57
-
58
-
59
53
  Usage
60
54
  =====
61
55
 
@@ -81,6 +75,14 @@ For more information, specify the `-h` flag:
81
75
  Change Log
82
76
  ==========
83
77
 
78
+ 0.0.48
79
+ ------
80
+ - Added commands for wbdutil (Wellbore DDMS Data Loader)
81
+
82
+ 0.0.47
83
+ ------
84
+ - Maintenance release
85
+
84
86
  0.0.46
85
87
  ------
86
88
  - Simpler install command without extra-index-url
@@ -3,13 +3,6 @@ OSDU Command Line Interface
3
3
 
4
4
  Command-line interface for interacting with OSDU.
5
5
 
6
- NOTE: With version 0.0.45 and earlier the pip install command may need extra parameter since a dependency is not available from pypi.org:
7
-
8
- .. code-block:: bash
9
-
10
- pip install osducli --extra-index-url=https://community.opengroup.org/api/v4/projects/148/packages/pypi/simple
11
-
12
-
13
6
  Usage
14
7
  =====
15
8
 
@@ -35,6 +28,14 @@ For more information, specify the `-h` flag:
35
28
  Change Log
36
29
  ==========
37
30
 
31
+ 0.0.48
32
+ ------
33
+ - Added commands for wbdutil (Wellbore DDMS Data Loader)
34
+
35
+ 0.0.47
36
+ ------
37
+ - Maintenance release
38
+
38
39
  0.0.46
39
40
  ------
40
41
  - Simpler install command without extra-index-url
@@ -29,6 +29,7 @@ dependencies = [
29
29
  "requests",
30
30
  "tabulate",
31
31
  "packaging",
32
+ "wbdutil==0.1.1",
32
33
  # Azure specific
33
34
  "msal",
34
35
  "msal-extensions",
@@ -100,5 +101,8 @@ disable = [
100
101
  "fixme",
101
102
  "unknown-option-value",
102
103
  "unspecified-encoding",
103
- "broad-exception-raised"
104
+ "broad-exception-raised",
105
+ "duplicate-code",
106
+ "unused-argument",
107
+ "too-many-statements",
104
108
  ]
@@ -0,0 +1 @@
1
+ 0.0.48
@@ -50,6 +50,7 @@ MSG_PROMPT_WORKFLOW_URL = "\nWorkflow API path []: "
50
50
 
51
51
  MSG_PROMPT_DATA_PARTITION = "\nData partition name []: "
52
52
  MSG_PROMPT_LEGAL_TAG = "\nManifest legal tag []: "
53
+ MSG_PROMPT_OTHER_RELEVANT_DATA_COUNTRIES = "\nOther relevant data countries []: "
53
54
  MSG_PROMPT_ACL_VIEWER = "\nacl viewer []: "
54
55
  MSG_PROMPT_ACL_OWNER = "\nacl owner []: "
55
56
 
@@ -37,6 +37,7 @@ from osducli.commands.config.consts import (
37
37
  MSG_PROMPT_LEGAL_TAG,
38
38
  MSG_PROMPT_LEGAL_URL,
39
39
  MSG_PROMPT_MANAGE_GLOBAL,
40
+ MSG_PROMPT_OTHER_RELEVANT_DATA_COUNTRIES,
40
41
  MSG_PROMPT_REFRESH_TOKEN,
41
42
  MSG_PROMPT_SCHEMA_URL,
42
43
  MSG_PROMPT_SCOPES,
@@ -64,6 +65,7 @@ from osducli.config import (
64
65
  CONFIG_FILE_URL,
65
66
  CONFIG_LEGAL_TAG,
66
67
  CONFIG_LEGAL_URL,
68
+ CONFIG_OTHER_RELEVANT_DATA_COUNTRIES,
67
69
  CONFIG_REFRESH_TOKEN,
68
70
  CONFIG_SCHEMA_URL,
69
71
  CONFIG_SEARCH_URL,
@@ -277,6 +279,12 @@ def _configure_connection(config): # noqa C901
277
279
  CONFIG_LEGAL_TAG,
278
280
  fallback="opendes-public-usa-dataset-7643990",
279
281
  )
282
+ other_relevant_data_countries = _prompt_default_from_config(
283
+ MSG_PROMPT_OTHER_RELEVANT_DATA_COUNTRIES,
284
+ config,
285
+ CONFIG_OTHER_RELEVANT_DATA_COUNTRIES,
286
+ fallback="US",
287
+ )
280
288
  acl_viewer = _prompt_default_from_config(
281
289
  MSG_PROMPT_ACL_VIEWER,
282
290
  config,
@@ -320,6 +328,8 @@ def _configure_connection(config): # noqa C901
320
328
  config.set_value("core", CONFIG_DATA_PARTITION_ID, data_partition_id)
321
329
  if legal_tag != "":
322
330
  config.set_value("core", CONFIG_LEGAL_TAG, legal_tag)
331
+ if other_relevant_data_countries != "":
332
+ config.set_value("core", CONFIG_OTHER_RELEVANT_DATA_COUNTRIES, other_relevant_data_countries)
323
333
  if acl_viewer != "":
324
334
  config.set_value("core", CONFIG_ACL_VIEWER, acl_viewer)
325
335
  if acl_owner != "":
@@ -38,8 +38,6 @@ logger = get_logger(__name__)
38
38
  "-b",
39
39
  "--batch",
40
40
  help="Number of records to add per API call. If not specified records are uploaded as is.",
41
- is_flag=False,
42
- flag_value=200,
43
41
  type=int,
44
42
  default=None,
45
43
  show_default=True,
@@ -0,0 +1,13 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ """Wellbore DDMS Data Loader commands"""
@@ -0,0 +1,16 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ """Wellbore DDMS Data Loader constants"""
14
+
15
+ WBDUTIL_SERVICE_NAME = "Wellbore DDMS Data Loader"
16
+ WBDUTIL_DOCUMENTATION = "https://community.opengroup.org/osdu/ui/data-loading/wellbore-ddms-data-loader" # noqa: E501
@@ -0,0 +1,40 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ import json
13
+ import tempfile
14
+
15
+ from osducli.config import CLIConfig
16
+
17
+
18
+ def get_config_path(config: CLIConfig):
19
+ """
20
+ Takes a config object and writes a mapped config to a temporary JSON file.
21
+ Returns the path to the temp file.
22
+ """
23
+ output = {
24
+ "base_url": config.get('core', 'server'),
25
+ "data_partition_id": config.get('core', 'data_partition_id'),
26
+ "legal": {
27
+ "legaltags": [config.get('core', 'legal_tag')],
28
+ "otherRelevantDataCountries": [config.get('core', 'other_relevant_data_countries')],
29
+ "status": "compliant"
30
+ },
31
+ "data": {
32
+ "default": {
33
+ "viewers": [config.get('core', 'acl_viewer')],
34
+ "owners": [config.get('core', 'acl_owner')]
35
+ }
36
+ }
37
+ }
38
+ with tempfile.NamedTemporaryFile('w', delete=False, suffix='.json') as tmp:
39
+ json.dump(output, tmp, indent=4)
40
+ return tmp.name
@@ -0,0 +1,38 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Retrieve WellLog data from an OSDU instance and save to a LAS format file"""
13
+ import os
14
+
15
+ import click
16
+ from wbdutil.commands.download import download_las
17
+
18
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
19
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
20
+ from osducli.commands.wbdutil.config_file import get_config_path
21
+
22
+
23
+ # click entry point
24
+ @click.command(cls=CustomClickCommand, help="Download WellLog data to LAS file")
25
+ @click.option("-id", "--id", "_id", help="WellLog id to retrieve", required=True)
26
+ @click.option("-o", "--out", "_file", help="The output file path", required=True)
27
+ @click.option("-c", "--curves", "_curves", help="List of curves to retrieve, or none to get all curves", required=False)
28
+ @handle_cli_exceptions
29
+ @command_with_output(None)
30
+ def _click_command(state: State, _id: str, _file: str, _curves: list[str]):
31
+ client = CliOsduClient(state.config)
32
+ client.token_refresher.authorize()
33
+ token = client.token_refresher.access_token
34
+ config_path = get_config_path(state.config)
35
+ try:
36
+ download_las(_id, _file, token, config_path, _curves)
37
+ finally:
38
+ os.remove(config_path)
@@ -0,0 +1,13 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ """Wellbore DDMS Data Loader ingest commands"""
@@ -0,0 +1,37 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Write data from a LAS file to an existing WellLog"""
13
+ import os
14
+
15
+ import click
16
+ from wbdutil.commands.ingest import welllog_data
17
+
18
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
19
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
20
+ from osducli.commands.wbdutil.config_file import get_config_path
21
+
22
+
23
+ # click entry point
24
+ @click.command(cls=CustomClickCommand, help="Write data from a LAS file to an existing WellLog")
25
+ @click.option("-id", "--id", "_id", help="WellLog id to update", required=True)
26
+ @click.option("-p", "--path", "_path", help=" Path to a file or folder containing one or more LAS file(s)", required=True)
27
+ @handle_cli_exceptions
28
+ @command_with_output(None)
29
+ def _click_command(state: State, _id: str, _path: str):
30
+ client = CliOsduClient(state.config)
31
+ client.token_refresher.authorize()
32
+ token = client.token_refresher.access_token
33
+ config_path = get_config_path(state.config)
34
+ try:
35
+ welllog_data(_id, _path, token, config_path)
36
+ finally:
37
+ os.remove(config_path)
@@ -0,0 +1,37 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Ingest a LAS file (single) or directory of LAS files (bulk) into OSDU"""
13
+ import os
14
+
15
+ import click
16
+ from wbdutil.commands.ingest import wellbore
17
+
18
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
19
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
20
+ from osducli.commands.wbdutil.config_file import get_config_path
21
+
22
+
23
+ # click entry point
24
+ @click.command(cls=CustomClickCommand, help="Ingest LAS file(s) into OSDU")
25
+ @click.option("-p", "--path", "_path", help="Path and filename of a LAS file OR path to directory containing LAS and config files", required=True)
26
+ @click.option("--norecognize", "_no_recognize", help="If specified the application won't attempt to recognize the curve families.", is_flag=True, required=False)
27
+ @handle_cli_exceptions
28
+ @command_with_output(None)
29
+ def _click_command(state: State, _path: str, _no_recognize: bool = False):
30
+ client = CliOsduClient(state.config)
31
+ client.token_refresher.authorize()
32
+ token = client.token_refresher.access_token
33
+ config_path = get_config_path(state.config)
34
+ try:
35
+ wellbore(_path, token, config_path, _no_recognize)
36
+ finally:
37
+ os.remove(config_path)
@@ -0,0 +1,13 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ """Wellbore DDMS Data Loader list commands"""
@@ -0,0 +1,38 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """ Retrieve and print WellLog record from an OSDU instance"""
13
+
14
+ import os
15
+
16
+ import click
17
+ from wbdutil.commands.list_osdu import welllog_data
18
+
19
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
20
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
21
+ from osducli.commands.wbdutil.config_file import get_config_path
22
+
23
+
24
+ # click entry point
25
+ @click.command(cls=CustomClickCommand, help="Retrieve and print WellLog curve data")
26
+ @click.option("-id", "--id", "_id", help="WellLog id to retrieve", required=True)
27
+ @click.option("-c", "--curves", "_curves", help="List of curves to retrieve, or none to get all curves", required=False)
28
+ @handle_cli_exceptions
29
+ @command_with_output(None)
30
+ def _click_command(state: State, _id: str, _curves: list[str]):
31
+ client = CliOsduClient(state.config)
32
+ client.token_refresher.authorize()
33
+ token = client.token_refresher.access_token
34
+ config_path = get_config_path(state.config)
35
+ try:
36
+ return welllog_data(_id, token, config_path, _curves)
37
+ finally:
38
+ os.remove(config_path)
@@ -0,0 +1,38 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """ Retrieve and print WellLog record from an OSDU instance"""
13
+
14
+ import os
15
+
16
+ import click
17
+ from wbdutil.commands.list_osdu import welllog
18
+
19
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
20
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
21
+ from osducli.commands.wbdutil.config_file import get_config_path
22
+
23
+
24
+ # click entry point
25
+ @click.command(cls=CustomClickCommand, help="Retrieve and print Wellbore record")
26
+ @click.option("-id", "--id", "_id", help="Wellbore id to retrieve", required=True)
27
+ @click.option("--curveids", "_curveids", help="Show only the curve ids", is_flag=True, required=False)
28
+ @handle_cli_exceptions
29
+ @command_with_output(None)
30
+ def _click_command(state: State, _id: str, _curveids: bool = False):
31
+ client = CliOsduClient(state.config)
32
+ client.token_refresher.authorize()
33
+ token = client.token_refresher.access_token
34
+ config_path = get_config_path(state.config)
35
+ try:
36
+ return welllog(_id, token, config_path, _curveids)
37
+ finally:
38
+ os.remove(config_path)
@@ -0,0 +1,38 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """ Retrieve and print WellLog record from an OSDU instance"""
13
+
14
+ import os
15
+
16
+ import click
17
+ from wbdutil.commands.list_osdu import welllog
18
+
19
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
20
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
21
+ from osducli.commands.wbdutil.config_file import get_config_path
22
+
23
+
24
+ # click entry point
25
+ @click.command(cls=CustomClickCommand, help="Retrieve and print WellLog record")
26
+ @click.option("-id", "--id", "_id", help="WellLog id to retrieve", required=True)
27
+ @click.option("--curveids", "_curveids", help="Show only the curve ids", is_flag=True, required=False)
28
+ @handle_cli_exceptions
29
+ @command_with_output(None)
30
+ def _click_command(state: State, _id: str, _curveids: bool = False):
31
+ client = CliOsduClient(state.config)
32
+ client.token_refresher.authorize()
33
+ token = client.token_refresher.access_token
34
+ config_path = get_config_path(state.config)
35
+ try:
36
+ return welllog(_id, token, config_path, _curveids)
37
+ finally:
38
+ os.remove(config_path)
@@ -0,0 +1,13 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ """Wellbore DDMS Data Loader parse commands"""
@@ -0,0 +1,35 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Convert a LAS file to Wellbore and Well Log and write to JSON files"""
13
+
14
+ import os
15
+
16
+ import click
17
+ from wbdutil.commands.parse import convert
18
+
19
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
20
+ from osducli.cliclient import handle_cli_exceptions
21
+ from osducli.commands.wbdutil.config_file import get_config_path
22
+
23
+
24
+ # click entry point
25
+ @click.command(cls=CustomClickCommand, help="Convert a LAS file to Wellbore and WellLog and write to JSON files")
26
+ @click.option("-id", "--id", "_id", help="Record id to retrieve", required=True)
27
+ @click.option("-i", "--input", "_file", help="Path to a file or folder containing one or more LAS file(s)", required=True)
28
+ @handle_cli_exceptions
29
+ @command_with_output(None)
30
+ def _click_command(state: State, _id: str, _file: str):
31
+ config_path = get_config_path(state.config)
32
+ try:
33
+ return convert(_file, _id, config_path)
34
+ finally:
35
+ os.remove(config_path)
@@ -0,0 +1,27 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Print a LAS file header"""
13
+
14
+ import click
15
+ from wbdutil.commands.parse import printlas
16
+
17
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
18
+ from osducli.cliclient import handle_cli_exceptions
19
+
20
+
21
+ # click entry point
22
+ @click.command(cls=CustomClickCommand, help="Print a LAS file header")
23
+ @click.option("-i", "--input", "_file", help="Path and filename of a LAS file, or folder containing LAS files", required=True)
24
+ @handle_cli_exceptions
25
+ @command_with_output(None)
26
+ def _click_command(state: State, _file: str):
27
+ return printlas(_file)
@@ -0,0 +1,36 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Retrieve and print the ids of wellbores that match the specified name"""
13
+ import os
14
+
15
+ import click
16
+ from wbdutil.commands.search import wellbore_search
17
+
18
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
19
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
20
+ from osducli.commands.wbdutil.config_file import get_config_path
21
+
22
+
23
+ # click entry point
24
+ @click.command(cls=CustomClickCommand, help="Retrieve and print the ids of wellbores that match the specified name")
25
+ @click.option("-n", "--name", "_name", help="The wellbore name to search for", required=True)
26
+ @handle_cli_exceptions
27
+ @command_with_output(None)
28
+ def _click_command(state: State, _name: str):
29
+ client = CliOsduClient(state.config)
30
+ client.token_refresher.authorize()
31
+ token = client.token_refresher.access_token
32
+ config_path = get_config_path(state.config)
33
+ try:
34
+ return wellbore_search(_name, token, config_path)
35
+ finally:
36
+ os.remove(config_path)
@@ -0,0 +1,37 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License");
2
+ # you may not use this file except in compliance with the License.
3
+ # You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+ """Update an existing WellLog record"""
13
+ import os
14
+
15
+ import click
16
+ from wbdutil.commands.update import welllog
17
+
18
+ from osducli.click_cli import CustomClickCommand, State, command_with_output
19
+ from osducli.cliclient import CliOsduClient, handle_cli_exceptions
20
+ from osducli.commands.wbdutil.config_file import get_config_path
21
+
22
+
23
+ # click entry point
24
+ @click.command(cls=CustomClickCommand, help="Update an existing WellLog record")
25
+ @click.option("-id", "--id", "_id", help="Record id to update", required=True)
26
+ @click.option("--curvefam", "_curvefam", help="If true, recognize and update the curve families", is_flag=True, required=False)
27
+ @handle_cli_exceptions
28
+ @command_with_output(None)
29
+ def _click_command(state: State, _id: str, _curvefam: bool = False):
30
+ client = CliOsduClient(state.config)
31
+ client.token_refresher.authorize()
32
+ token = client.token_refresher.access_token
33
+ config_path = get_config_path(state.config)
34
+ try:
35
+ return welllog(_id, token, config_path, _curvefam)
36
+ finally:
37
+ os.remove(config_path)
@@ -44,6 +44,7 @@ CONFIG_WELLBORE_DDMS_URL = "wellbore_ddms_url"
44
44
 
45
45
  CONFIG_DATA_PARTITION_ID = "data_partition_id"
46
46
  CONFIG_LEGAL_TAG = "legal_tag"
47
+ CONFIG_OTHER_RELEVANT_DATA_COUNTRIES = "other_relevant_data_countries"
47
48
  CONFIG_ACL_VIEWER = "acl_viewer"
48
49
  CONFIG_ACL_OWNER = "acl_owner"
49
50