pltr-cli 0.9.3__py3-none-any.whl → 0.10.0__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.
- pltr/__init__.py +1 -1
- pltr/commands/folder.py +3 -3
- pltr/commands/orchestration.py +40 -1
- pltr/commands/resource.py +63 -2
- pltr/services/resource.py +16 -0
- pltr/utils/formatting.py +9 -3
- {pltr_cli-0.9.3.dist-info → pltr_cli-0.10.0.dist-info}/METADATA +1 -1
- {pltr_cli-0.9.3.dist-info → pltr_cli-0.10.0.dist-info}/RECORD +11 -11
- {pltr_cli-0.9.3.dist-info → pltr_cli-0.10.0.dist-info}/WHEEL +0 -0
- {pltr_cli-0.9.3.dist-info → pltr_cli-0.10.0.dist-info}/entry_points.txt +0 -0
- {pltr_cli-0.9.3.dist-info → pltr_cli-0.10.0.dist-info}/licenses/LICENSE +0 -0
pltr/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.10.0"
|
pltr/commands/folder.py
CHANGED
|
@@ -279,7 +279,7 @@ def _format_children_table(children: List[dict]):
|
|
|
279
279
|
table = Table(title="Folder Children", show_header=True, header_style="bold cyan")
|
|
280
280
|
table.add_column("Type", style="cyan")
|
|
281
281
|
table.add_column("Display Name")
|
|
282
|
-
table.add_column("RID")
|
|
282
|
+
table.add_column("RID", no_wrap=True)
|
|
283
283
|
|
|
284
284
|
for child in children:
|
|
285
285
|
table.add_row(
|
|
@@ -296,8 +296,8 @@ def _format_folders_batch_table(folders: List[dict]):
|
|
|
296
296
|
"""Format multiple folders as a table."""
|
|
297
297
|
table = Table(title="Folders", show_header=True, header_style="bold cyan")
|
|
298
298
|
table.add_column("Display Name")
|
|
299
|
-
table.add_column("RID")
|
|
300
|
-
table.add_column("Parent Folder")
|
|
299
|
+
table.add_column("RID", no_wrap=True)
|
|
300
|
+
table.add_column("Parent Folder", no_wrap=True)
|
|
301
301
|
table.add_column("Description")
|
|
302
302
|
|
|
303
303
|
for folder in folders:
|
pltr/commands/orchestration.py
CHANGED
|
@@ -92,7 +92,46 @@ def create_build(
|
|
|
92
92
|
"table", "--format", "-f", help="Output format (table, json, csv)"
|
|
93
93
|
),
|
|
94
94
|
):
|
|
95
|
-
"""
|
|
95
|
+
"""
|
|
96
|
+
Create a new build with specified target datasets.
|
|
97
|
+
|
|
98
|
+
The target parameter must be a JSON object with a 'type' field that specifies
|
|
99
|
+
the build strategy. Three types are supported:
|
|
100
|
+
|
|
101
|
+
\b
|
|
102
|
+
1. Manual Build - Explicitly specify datasets to build:
|
|
103
|
+
{
|
|
104
|
+
"type": "manual",
|
|
105
|
+
"targetRids": ["ri.foundry.main.dataset.abc123..."]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
\b
|
|
109
|
+
2. Upstream Build - Build target datasets and all their upstream dependencies:
|
|
110
|
+
{
|
|
111
|
+
"type": "upstream",
|
|
112
|
+
"targetRids": ["ri.foundry.main.dataset.abc123..."],
|
|
113
|
+
"ignoredRids": []
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
\b
|
|
117
|
+
3. Connecting Build - Build datasets between input and target datasets:
|
|
118
|
+
{
|
|
119
|
+
"type": "connecting",
|
|
120
|
+
"inputRids": ["ri.foundry.main.dataset.input123..."],
|
|
121
|
+
"targetRids": ["ri.foundry.main.dataset.target123..."],
|
|
122
|
+
"ignoredRids": []
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
Examples:
|
|
126
|
+
|
|
127
|
+
\b
|
|
128
|
+
# Build specific datasets manually
|
|
129
|
+
pltr orchestration builds create '{"type": "manual", "targetRids": ["ri.foundry.main.dataset.abc123"]}' --branch master
|
|
130
|
+
|
|
131
|
+
\b
|
|
132
|
+
# Build dataset and all upstream dependencies
|
|
133
|
+
pltr orchestration builds create '{"type": "upstream", "targetRids": ["ri.foundry.main.dataset.abc123"], "ignoredRids": []}' --branch master --force
|
|
134
|
+
"""
|
|
96
135
|
try:
|
|
97
136
|
service = OrchestrationService(profile=profile)
|
|
98
137
|
|
pltr/commands/resource.py
CHANGED
|
@@ -79,6 +79,64 @@ def get_resource(
|
|
|
79
79
|
raise typer.Exit(1)
|
|
80
80
|
|
|
81
81
|
|
|
82
|
+
@app.command("get-by-path")
|
|
83
|
+
def get_resource_by_path(
|
|
84
|
+
path: str = typer.Argument(
|
|
85
|
+
...,
|
|
86
|
+
help="Absolute path to the resource (e.g., '/My Organization/Project/Dataset')",
|
|
87
|
+
),
|
|
88
|
+
profile: Optional[str] = typer.Option(
|
|
89
|
+
None, "--profile", help="Profile name", autocompletion=complete_profile
|
|
90
|
+
),
|
|
91
|
+
format: str = typer.Option(
|
|
92
|
+
"table",
|
|
93
|
+
"--format",
|
|
94
|
+
"-f",
|
|
95
|
+
help="Output format (table, json, csv)",
|
|
96
|
+
autocompletion=complete_output_format,
|
|
97
|
+
),
|
|
98
|
+
output: Optional[str] = typer.Option(
|
|
99
|
+
None, "--output", "-o", help="Output file path"
|
|
100
|
+
),
|
|
101
|
+
):
|
|
102
|
+
"""Get detailed information about a specific resource by its path."""
|
|
103
|
+
try:
|
|
104
|
+
service = ResourceService(profile=profile)
|
|
105
|
+
|
|
106
|
+
with SpinnerProgressTracker().track_spinner(
|
|
107
|
+
f"Fetching resource at path '{path}'..."
|
|
108
|
+
):
|
|
109
|
+
resource = service.get_resource_by_path(path)
|
|
110
|
+
|
|
111
|
+
# Cache the RID for future completions
|
|
112
|
+
if resource.get("rid"):
|
|
113
|
+
cache_rid(resource["rid"])
|
|
114
|
+
|
|
115
|
+
# Format output
|
|
116
|
+
if format == "json":
|
|
117
|
+
if output:
|
|
118
|
+
formatter.save_to_file(resource, output, "json")
|
|
119
|
+
else:
|
|
120
|
+
formatter.format_dict(resource)
|
|
121
|
+
elif format == "csv":
|
|
122
|
+
if output:
|
|
123
|
+
formatter.save_to_file([resource], output, "csv")
|
|
124
|
+
else:
|
|
125
|
+
formatter.format_list([resource])
|
|
126
|
+
else:
|
|
127
|
+
_format_resource_table(resource)
|
|
128
|
+
|
|
129
|
+
if output:
|
|
130
|
+
formatter.print_success(f"Resource information saved to {output}")
|
|
131
|
+
|
|
132
|
+
except (ProfileNotFoundError, MissingCredentialsError) as e:
|
|
133
|
+
formatter.print_error(f"Authentication error: {e}")
|
|
134
|
+
raise typer.Exit(1)
|
|
135
|
+
except Exception as e:
|
|
136
|
+
formatter.print_error(f"Failed to get resource: {e}")
|
|
137
|
+
raise typer.Exit(1)
|
|
138
|
+
|
|
139
|
+
|
|
82
140
|
@app.command("list")
|
|
83
141
|
def list_resources(
|
|
84
142
|
folder_rid: Optional[str] = typer.Option(
|
|
@@ -469,12 +527,15 @@ def main():
|
|
|
469
527
|
|
|
470
528
|
Manage resources in the Foundry filesystem. Get resource information,
|
|
471
529
|
search resources, manage metadata, and perform operations using Resource
|
|
472
|
-
Identifiers (RIDs).
|
|
530
|
+
Identifiers (RIDs) or paths.
|
|
473
531
|
|
|
474
532
|
Examples:
|
|
475
|
-
# Get resource information
|
|
533
|
+
# Get resource information by RID
|
|
476
534
|
pltr resource get ri.compass.main.dataset.xyz123
|
|
477
535
|
|
|
536
|
+
# Get resource information by path
|
|
537
|
+
pltr resource get-by-path "/My Organization/Project/Dataset Name"
|
|
538
|
+
|
|
478
539
|
# List all resources
|
|
479
540
|
pltr resource list
|
|
480
541
|
|
pltr/services/resource.py
CHANGED
|
@@ -30,6 +30,22 @@ class ResourceService(BaseService):
|
|
|
30
30
|
except Exception as e:
|
|
31
31
|
raise RuntimeError(f"Failed to get resource {resource_rid}: {e}")
|
|
32
32
|
|
|
33
|
+
def get_resource_by_path(self, path: str) -> Dict[str, Any]:
|
|
34
|
+
"""
|
|
35
|
+
Get information about a specific resource by its path.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
path: Absolute path to the resource (e.g., "/My Organization/Project/Dataset")
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Resource information dictionary
|
|
42
|
+
"""
|
|
43
|
+
try:
|
|
44
|
+
resource = self.service.Resource.get_by_path(path=path, preview=True)
|
|
45
|
+
return self._format_resource_info(resource)
|
|
46
|
+
except Exception as e:
|
|
47
|
+
raise RuntimeError(f"Failed to get resource at path '{path}': {e}")
|
|
48
|
+
|
|
33
49
|
def list_resources(
|
|
34
50
|
self,
|
|
35
51
|
folder_rid: Optional[str] = None,
|
pltr/utils/formatting.py
CHANGED
|
@@ -64,7 +64,8 @@ class OutputFormatter:
|
|
|
64
64
|
f.write(json_str)
|
|
65
65
|
return None
|
|
66
66
|
else:
|
|
67
|
-
|
|
67
|
+
# Use plain print to ensure valid JSON output without ANSI codes
|
|
68
|
+
print(json_str)
|
|
68
69
|
return json_str
|
|
69
70
|
|
|
70
71
|
def _format_csv(
|
|
@@ -141,7 +142,11 @@ class OutputFormatter:
|
|
|
141
142
|
|
|
142
143
|
# Add columns to table
|
|
143
144
|
for column in columns:
|
|
144
|
-
|
|
145
|
+
# Don't truncate RID columns - they need full visibility
|
|
146
|
+
if "rid" in column.lower():
|
|
147
|
+
table.add_column(column, no_wrap=True, overflow="fold")
|
|
148
|
+
else:
|
|
149
|
+
table.add_column(column, overflow="fold")
|
|
145
150
|
|
|
146
151
|
# Add rows
|
|
147
152
|
for item in data:
|
|
@@ -424,7 +429,8 @@ class OutputFormatter:
|
|
|
424
429
|
else:
|
|
425
430
|
# For simple values, just print them
|
|
426
431
|
if format_type == "json":
|
|
427
|
-
|
|
432
|
+
# Use plain print to ensure valid JSON output without ANSI codes
|
|
433
|
+
print(json.dumps(data, indent=2, default=str))
|
|
428
434
|
else:
|
|
429
435
|
rich_print(str(data))
|
|
430
436
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pltr/__init__.py,sha256=
|
|
1
|
+
pltr/__init__.py,sha256=v4zmKjsKOPZbp6BrWoz7iK4ST0sdZdUh9bQSJmluZ5o,23
|
|
2
2
|
pltr/__main__.py,sha256=HWJ49UoAYBQCf8kjuySPmBTuUjTZrOx-y6PzMTyS1KE,879
|
|
3
3
|
pltr/cli.py,sha256=DikRsWsU7QWvRWHgB6wZIct916ebWyaub7PlAjKJXws,2664
|
|
4
4
|
pltr/auth/__init__.py,sha256=G0V-Rh25FaJsH2nhrf146XQQG_ApdbyPJNuHJC25kgk,38
|
|
@@ -14,12 +14,12 @@ pltr/commands/completion.py,sha256=YTxaRL4-rDs5n7aXf3ogFsxbHVJUBo_HiBbd0fbBPZ0,1
|
|
|
14
14
|
pltr/commands/configure.py,sha256=oYj-VlOEj3MDwtB2RC4bYOYzI_sXTanPnz7y1GmMTqY,4800
|
|
15
15
|
pltr/commands/connectivity.py,sha256=m8_BYwHij_5IbrYFTU_SYYtbqLCjxA8VIQpbdlWJqHs,14758
|
|
16
16
|
pltr/commands/dataset.py,sha256=zuYtBXAGcfRjxE7cP9Hsz2tqSlsdNzdIflGKwytHbVI,53346
|
|
17
|
-
pltr/commands/folder.py,sha256=
|
|
17
|
+
pltr/commands/folder.py,sha256=ItUp49lyDWIoMv8RaNDo7JFyrlk-r_Klab9FCPXwUM8,10721
|
|
18
18
|
pltr/commands/mediasets.py,sha256=FXq7OtYU9wLgUxQFcS_fkA4i_CozGnsYKxh8GOSI0ok,15342
|
|
19
19
|
pltr/commands/ontology.py,sha256=zUgSrmv8xi26SQK7GsM3qusgR9Wuka0GyzE7L8DkduE,18317
|
|
20
|
-
pltr/commands/orchestration.py,sha256=
|
|
20
|
+
pltr/commands/orchestration.py,sha256=mizGJIuMEJGAW9-ic_q-WawAe4PKBgtJSUfysk6YI68,23227
|
|
21
21
|
pltr/commands/project.py,sha256=nlfyy4OYkYK9rtjOQp9awgCnSJ1P6sgsp0vaXdvkHFY,14183
|
|
22
|
-
pltr/commands/resource.py,sha256=
|
|
22
|
+
pltr/commands/resource.py,sha256=8lS_iHqkvjKwodvPwqaTD2vYbHwPdEx3U1u3IDgvcA4,18392
|
|
23
23
|
pltr/commands/resource_role.py,sha256=pM0DQxLBU9xyIYzLv1Y0sOMZG5oZ1INNSkMubYBGHJM,15394
|
|
24
24
|
pltr/commands/shell.py,sha256=QLF7TEGpaau9i0A9s3VjnegvtHde-SLRqI4suJFT4WI,3622
|
|
25
25
|
pltr/commands/space.py,sha256=R9TN9OQVDtFB92DOjrh81_YYajiQaqRNELsBHK4O-pI,21944
|
|
@@ -39,17 +39,17 @@ pltr/services/mediasets.py,sha256=HgHNFWoG9r-5xupANVOxHg_h5EKsBDl6PsO8hwdbm28,98
|
|
|
39
39
|
pltr/services/ontology.py,sha256=iW7qRK8ptlw-u4eAwLNC-mdzLoLZzh7SRqJyok2c3GU,14883
|
|
40
40
|
pltr/services/orchestration.py,sha256=z1lofohVNRVlKyHffo_K1-I-1f9ZqsLKxQuyUOhAGlY,14729
|
|
41
41
|
pltr/services/project.py,sha256=nwLXBX0MWgOnVQ7CAZQHnzZtSJY_hqlGyooFngQSjcc,7740
|
|
42
|
-
pltr/services/resource.py,sha256=
|
|
42
|
+
pltr/services/resource.py,sha256=J7cGsgy5lsWGu5fGhOQOo5TgFY7x0oCk3e1CRB3V9Dw,10186
|
|
43
43
|
pltr/services/resource_role.py,sha256=Ootor16c6PR9TNxe6KJyd4W2lYM_HHDxJk-JvZhgRxU,10608
|
|
44
44
|
pltr/services/space.py,sha256=4uea1nQ6CA-6_xWoD6n49E4Zm6KbW_7Cq9o89JorMTE,11544
|
|
45
45
|
pltr/services/sql.py,sha256=19cscjlzN8WE1s8_ctiRcrOvMzCfmWRj49vjJ8Gs5Q4,11286
|
|
46
46
|
pltr/utils/__init__.py,sha256=DF7TigL1XbKVGM5VjgU8_8AGIszofkdO80oCzLGGnTE,38
|
|
47
47
|
pltr/utils/alias_resolver.py,sha256=DIF7P1UnUU8kqocJfIDEWjYq4s8_0KfqRZBbECeZEh8,1539
|
|
48
48
|
pltr/utils/completion.py,sha256=bjeqjleEfB2YcQFpcxvF0GoQ763F6KBbULSZC4FWY_g,4980
|
|
49
|
-
pltr/utils/formatting.py,sha256=
|
|
49
|
+
pltr/utils/formatting.py,sha256=TpxbOXdXbk_aUUnj8FrjMPLSnTmtlpYZf0Oe6g6Wmvc,50626
|
|
50
50
|
pltr/utils/progress.py,sha256=BKYbiLO61uhQbibabU7pxvvbAWMRLRmqk4pZldBQK_g,9053
|
|
51
|
-
pltr_cli-0.
|
|
52
|
-
pltr_cli-0.
|
|
53
|
-
pltr_cli-0.
|
|
54
|
-
pltr_cli-0.
|
|
55
|
-
pltr_cli-0.
|
|
51
|
+
pltr_cli-0.10.0.dist-info/METADATA,sha256=O7p1YyacTGJBw2idpx61qTg7kWa5e31-zgVDvbLG80o,17715
|
|
52
|
+
pltr_cli-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
53
|
+
pltr_cli-0.10.0.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
|
|
54
|
+
pltr_cli-0.10.0.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
|
|
55
|
+
pltr_cli-0.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|