pltr-cli 0.4.0__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pltr/__init__.py +1 -1
- pltr/cli.py +22 -0
- pltr/commands/connectivity.py +432 -0
- pltr/commands/dataset.py +577 -0
- pltr/commands/mediasets.py +422 -0
- pltr/commands/orchestration.py +642 -0
- pltr/commands/project.py +440 -0
- pltr/commands/resource.py +499 -0
- pltr/commands/resource_role.py +454 -0
- pltr/commands/space.py +662 -0
- pltr/services/connectivity.py +305 -0
- pltr/services/dataset.py +603 -10
- pltr/services/mediasets.py +293 -0
- pltr/services/orchestration.py +457 -0
- pltr/services/project.py +232 -0
- pltr/services/resource.py +289 -0
- pltr/services/resource_role.py +321 -0
- pltr/services/space.py +354 -0
- pltr/utils/formatting.py +745 -0
- pltr_cli-0.5.1.dist-info/METADATA +513 -0
- {pltr_cli-0.4.0.dist-info → pltr_cli-0.5.1.dist-info}/RECORD +24 -12
- pltr/services/dataset_full.py +0 -302
- pltr/services/dataset_v2.py +0 -128
- pltr_cli-0.4.0.dist-info/METADATA +0 -287
- {pltr_cli-0.4.0.dist-info → pltr_cli-0.5.1.dist-info}/WHEEL +0 -0
- {pltr_cli-0.4.0.dist-info → pltr_cli-0.5.1.dist-info}/entry_points.txt +0 -0
- {pltr_cli-0.4.0.dist-info → pltr_cli-0.5.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pltr-cli
|
|
3
|
+
Version: 0.5.1
|
|
4
|
+
Summary: Command-line interface for Palantir Foundry APIs
|
|
5
|
+
Project-URL: Homepage, https://github.com/anjor/pltr-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/anjor/pltr-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/anjor/pltr-cli/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/anjor/pltr-cli/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Documentation, https://github.com/anjor/pltr-cli/blob/main/README.md
|
|
10
|
+
Author-email: anjor <anjor@umd.edu>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: api,cli,data,foundry,ontology,palantir
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: System Administrators
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Classifier: Topic :: System :: Systems Administration
|
|
27
|
+
Classifier: Topic :: Utilities
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Requires-Dist: click-repl>=0.3.0
|
|
30
|
+
Requires-Dist: foundry-platform-sdk>=1.27.0
|
|
31
|
+
Requires-Dist: keyring>=25.6.0
|
|
32
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
33
|
+
Requires-Dist: requests>=2.32.4
|
|
34
|
+
Requires-Dist: rich>=14.1.0
|
|
35
|
+
Requires-Dist: typer>=0.16.0
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# pltr-cli
|
|
39
|
+
|
|
40
|
+
A comprehensive command-line interface for Palantir Foundry APIs, providing 80+ commands for data analysis, dataset management, ontology operations, orchestration, SQL queries, folder management, and administrative tasks.
|
|
41
|
+
|
|
42
|
+
## Overview
|
|
43
|
+
|
|
44
|
+
`pltr-cli` provides a powerful and intuitive way to interact with Palantir Foundry from the command line. Built on top of the official `foundry-platform-sdk`, it offers comprehensive access to Foundry's capabilities with a focus on productivity and ease of use.
|
|
45
|
+
|
|
46
|
+
## ✨ Key Features
|
|
47
|
+
|
|
48
|
+
- 🔐 **Secure Authentication**: Token and OAuth2 support with encrypted credential storage
|
|
49
|
+
- 📊 **Dataset Operations**: Complete dataset management with branches, files, transactions, and views (RID-based API)
|
|
50
|
+
- 📁 **Filesystem Management**: Complete filesystem operations including folders, projects, spaces, and resources
|
|
51
|
+
- 🏗️ **Project Management**: Create, update, and manage Foundry projects within spaces
|
|
52
|
+
- 🌐 **Space Management**: Administer spaces, manage members, and control access
|
|
53
|
+
- 🔐 **Resource Permissions**: Grant, revoke, and manage role-based access to resources
|
|
54
|
+
- 🔗 **Connectivity & Imports**: Manage external connections and import files/tables from various data sources
|
|
55
|
+
- 🎯 **Comprehensive Ontology Access**: 13 commands for objects, actions, and queries
|
|
56
|
+
- 🏗️ **Orchestration Management**: Create, manage, and monitor builds, jobs, and schedules
|
|
57
|
+
- 🎬 **MediaSets Operations**: Upload, download, and manage media content with transaction support
|
|
58
|
+
- 📝 **Full SQL Support**: Execute, submit, monitor, and export query results
|
|
59
|
+
- 👥 **Admin Operations**: User, group, role, and organization management (16 commands)
|
|
60
|
+
- 💻 **Interactive Shell**: REPL mode with tab completion and command history
|
|
61
|
+
- ⚡ **Shell Completion**: Auto-completion for bash, zsh, and fish
|
|
62
|
+
- 🎨 **Rich Output**: Beautiful terminal formatting with multiple export formats (table, JSON, CSV)
|
|
63
|
+
- 👤 **Multi-Profile Support**: Manage multiple Foundry environments seamlessly
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
### Using pip
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install pltr-cli
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### From source
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Clone the repository
|
|
77
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
78
|
+
cd pltr-cli
|
|
79
|
+
|
|
80
|
+
# Install with uv
|
|
81
|
+
uv sync
|
|
82
|
+
|
|
83
|
+
# Run the CLI
|
|
84
|
+
uv run pltr --help
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 🚀 Quick Start
|
|
88
|
+
|
|
89
|
+
### 1. Configure Authentication
|
|
90
|
+
|
|
91
|
+
Set up your Foundry credentials:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pltr configure configure
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Follow the interactive prompts to enter:
|
|
98
|
+
- Foundry hostname (e.g., `foundry.company.com`)
|
|
99
|
+
- Authentication method (token or OAuth2)
|
|
100
|
+
- Your credentials
|
|
101
|
+
|
|
102
|
+
### 2. Verify Connection
|
|
103
|
+
|
|
104
|
+
Test your setup:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
pltr verify
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 3. Start Exploring
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Check current user
|
|
114
|
+
pltr admin user current
|
|
115
|
+
|
|
116
|
+
# List available ontologies
|
|
117
|
+
pltr ontology list
|
|
118
|
+
|
|
119
|
+
# Search for builds
|
|
120
|
+
pltr orchestration builds search
|
|
121
|
+
|
|
122
|
+
# Create a new folder
|
|
123
|
+
pltr folder create "My Project"
|
|
124
|
+
|
|
125
|
+
# List root folder contents
|
|
126
|
+
pltr folder list ri.compass.main.folder.0
|
|
127
|
+
|
|
128
|
+
# Manage spaces and projects
|
|
129
|
+
pltr space list
|
|
130
|
+
pltr project create "My Project" ri.compass.main.space.123
|
|
131
|
+
pltr project list --space-rid ri.compass.main.space.123
|
|
132
|
+
|
|
133
|
+
# Manage resource permissions
|
|
134
|
+
pltr resource-role grant ri.compass.main.dataset.123 user123 User viewer
|
|
135
|
+
pltr resource-role list ri.compass.main.dataset.123
|
|
136
|
+
|
|
137
|
+
# Execute a simple SQL query
|
|
138
|
+
pltr sql execute "SELECT 1 as test"
|
|
139
|
+
|
|
140
|
+
# Explore dataset operations (requires dataset RID)
|
|
141
|
+
pltr dataset get ri.foundry.main.dataset.abc123
|
|
142
|
+
pltr dataset branches list ri.foundry.main.dataset.abc123
|
|
143
|
+
pltr dataset files list ri.foundry.main.dataset.abc123
|
|
144
|
+
|
|
145
|
+
# Dataset transaction management
|
|
146
|
+
pltr dataset transactions start ri.foundry.main.dataset.abc123
|
|
147
|
+
pltr dataset transactions commit ri.foundry.main.dataset.abc123 <transaction-rid>
|
|
148
|
+
pltr dataset files upload myfile.csv ri.foundry.main.dataset.abc123 --transaction-rid <rid>
|
|
149
|
+
|
|
150
|
+
# Start interactive mode for exploration
|
|
151
|
+
pltr shell
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 4. Enable Shell Completion
|
|
155
|
+
|
|
156
|
+
For the best experience:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pltr completion install
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
📖 **Need more help?** See the **[Quick Start Guide](docs/user-guide/quick-start.md)** for detailed setup instructions.
|
|
163
|
+
|
|
164
|
+
## 📚 Documentation
|
|
165
|
+
|
|
166
|
+
pltr-cli provides comprehensive documentation to help you get the most out of the tool:
|
|
167
|
+
|
|
168
|
+
### 📖 User Guides
|
|
169
|
+
- **[Quick Start Guide](docs/user-guide/quick-start.md)** - Get up and running in 5 minutes
|
|
170
|
+
- **[Authentication Setup](docs/user-guide/authentication.md)** - Complete guide to token and OAuth2 setup
|
|
171
|
+
- **[Command Reference](docs/user-guide/commands.md)** - Complete reference for all 70+ commands
|
|
172
|
+
- **[Common Workflows](docs/user-guide/workflows.md)** - Real-world data analysis patterns
|
|
173
|
+
- **[Troubleshooting](docs/user-guide/troubleshooting.md)** - Solutions to common issues
|
|
174
|
+
|
|
175
|
+
### 🔧 Developer Resources
|
|
176
|
+
- **[API Wrapper Documentation](docs/api/wrapper.md)** - Architecture and extension guide
|
|
177
|
+
- **[Examples Gallery](docs/examples/gallery.md)** - Real-world use cases and automation scripts
|
|
178
|
+
|
|
179
|
+
### 🎯 Quick Command Overview
|
|
180
|
+
|
|
181
|
+
**Most Common Commands:**
|
|
182
|
+
```bash
|
|
183
|
+
# Authentication & Setup
|
|
184
|
+
pltr configure configure # Set up authentication
|
|
185
|
+
pltr verify # Test connection
|
|
186
|
+
|
|
187
|
+
# Data Analysis
|
|
188
|
+
pltr sql execute "SELECT * FROM table" # Run SQL queries
|
|
189
|
+
pltr ontology list # List ontologies
|
|
190
|
+
pltr dataset get <rid> # Get dataset info
|
|
191
|
+
|
|
192
|
+
# Filesystem Management
|
|
193
|
+
pltr folder create "My Project" # Create folders
|
|
194
|
+
pltr space create "Team Space" <org-rid> # Create spaces
|
|
195
|
+
pltr project create "New Project" <space-rid> # Create projects
|
|
196
|
+
pltr resource search "dataset name" # Search resources
|
|
197
|
+
pltr resource-role grant <resource-rid> <user-id> User viewer # Grant permissions
|
|
198
|
+
|
|
199
|
+
# Orchestration
|
|
200
|
+
pltr orchestration builds search # Search builds
|
|
201
|
+
pltr orchestration jobs get <job-rid> # Get job details
|
|
202
|
+
pltr orchestration schedules create # Create schedule
|
|
203
|
+
|
|
204
|
+
# MediaSets
|
|
205
|
+
pltr media-sets get <set-rid> <item-rid> # Get media item info
|
|
206
|
+
pltr media-sets upload <set-rid> file.jpg "/path/file.jpg" <txn-id> # Upload media
|
|
207
|
+
pltr media-sets download <set-rid> <item-rid> output.jpg # Download media
|
|
208
|
+
|
|
209
|
+
# Connectivity & Data Imports
|
|
210
|
+
pltr connectivity connection list # List available connections
|
|
211
|
+
pltr connectivity connection get <conn-rid> # Get connection details
|
|
212
|
+
pltr connectivity import file <conn-rid> <source-path> <dataset-rid> --execute # Import file
|
|
213
|
+
pltr connectivity import table <conn-rid> <table-name> <dataset-rid> --execute # Import table
|
|
214
|
+
|
|
215
|
+
# Administrative
|
|
216
|
+
pltr admin user current # Current user info
|
|
217
|
+
pltr admin user list # List users
|
|
218
|
+
|
|
219
|
+
# Interactive & Tools
|
|
220
|
+
pltr shell # Interactive mode
|
|
221
|
+
pltr completion install # Enable tab completion
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
💡 **Tip**: Use `pltr --help` or `pltr <command> --help` for detailed command help.
|
|
225
|
+
|
|
226
|
+
For the complete command reference with examples, see **[Command Reference](docs/user-guide/commands.md)**.
|
|
227
|
+
|
|
228
|
+
### 🏗️ Orchestration Commands
|
|
229
|
+
|
|
230
|
+
pltr-cli provides comprehensive support for Foundry's Orchestration module:
|
|
231
|
+
|
|
232
|
+
#### Build Management
|
|
233
|
+
```bash
|
|
234
|
+
# Search for builds
|
|
235
|
+
pltr orchestration builds search
|
|
236
|
+
|
|
237
|
+
# Get build details
|
|
238
|
+
pltr orchestration builds get ri.orchestration.main.build.12345
|
|
239
|
+
|
|
240
|
+
# Create a new build
|
|
241
|
+
pltr orchestration builds create '{"dataset_rid": "ri.foundry.main.dataset.abc"}' --branch main
|
|
242
|
+
|
|
243
|
+
# Cancel a running build
|
|
244
|
+
pltr orchestration builds cancel ri.orchestration.main.build.12345
|
|
245
|
+
|
|
246
|
+
# List jobs in a build
|
|
247
|
+
pltr orchestration builds jobs ri.orchestration.main.build.12345
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### Job Management
|
|
251
|
+
```bash
|
|
252
|
+
# Get job details
|
|
253
|
+
pltr orchestration jobs get ri.orchestration.main.job.12345
|
|
254
|
+
|
|
255
|
+
# Get multiple jobs in batch
|
|
256
|
+
pltr orchestration jobs get-batch "rid1,rid2,rid3"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### Schedule Management
|
|
260
|
+
```bash
|
|
261
|
+
# Get schedule information
|
|
262
|
+
pltr orchestration schedules get ri.orchestration.main.schedule.12345
|
|
263
|
+
|
|
264
|
+
# Create a new schedule
|
|
265
|
+
pltr orchestration schedules create '{"type": "BUILD", "target": "dataset-rid"}' \
|
|
266
|
+
--name "Daily Build" --description "Automated daily build"
|
|
267
|
+
|
|
268
|
+
# Pause/unpause schedules
|
|
269
|
+
pltr orchestration schedules pause ri.orchestration.main.schedule.12345
|
|
270
|
+
pltr orchestration schedules unpause ri.orchestration.main.schedule.12345
|
|
271
|
+
|
|
272
|
+
# Execute schedule immediately
|
|
273
|
+
pltr orchestration schedules run ri.orchestration.main.schedule.12345
|
|
274
|
+
|
|
275
|
+
# Delete a schedule
|
|
276
|
+
pltr orchestration schedules delete ri.orchestration.main.schedule.12345 --yes
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**All orchestration commands support:**
|
|
280
|
+
- Multiple output formats (table, JSON, CSV)
|
|
281
|
+
- File output (`--output filename`)
|
|
282
|
+
- Profile selection (`--profile production`)
|
|
283
|
+
- Preview mode for schedules (`--preview`)
|
|
284
|
+
|
|
285
|
+
### 🎬 MediaSets Commands
|
|
286
|
+
|
|
287
|
+
pltr-cli provides full support for Foundry's MediaSets module for managing media content:
|
|
288
|
+
|
|
289
|
+
#### Media Item Operations
|
|
290
|
+
```bash
|
|
291
|
+
# Get media item information
|
|
292
|
+
pltr media-sets get ri.mediasets.main.media-set.abc ri.mediasets.main.media-item.123
|
|
293
|
+
|
|
294
|
+
# Get media item RID by path
|
|
295
|
+
pltr media-sets get-by-path ri.mediasets.main.media-set.abc "/images/photo.jpg"
|
|
296
|
+
|
|
297
|
+
# Get a reference for embedding
|
|
298
|
+
pltr media-sets reference ri.mediasets.main.media-set.abc ri.mediasets.main.media-item.123
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
#### Transaction Management
|
|
302
|
+
```bash
|
|
303
|
+
# Create a new upload transaction
|
|
304
|
+
pltr media-sets create ri.mediasets.main.media-set.abc --branch main
|
|
305
|
+
|
|
306
|
+
# Commit transaction (makes uploads available)
|
|
307
|
+
pltr media-sets commit ri.mediasets.main.media-set.abc transaction-id-12345
|
|
308
|
+
|
|
309
|
+
# Abort transaction (deletes uploads)
|
|
310
|
+
pltr media-sets abort ri.mediasets.main.media-set.abc transaction-id-12345 --yes
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### Upload and Download
|
|
314
|
+
```bash
|
|
315
|
+
# Upload a file to media set
|
|
316
|
+
pltr media-sets upload ri.mediasets.main.media-set.abc \
|
|
317
|
+
/local/path/image.jpg "/media/images/image.jpg" transaction-id-12345
|
|
318
|
+
|
|
319
|
+
# Download media item (processed version)
|
|
320
|
+
pltr media-sets download ri.mediasets.main.media-set.abc \
|
|
321
|
+
ri.mediasets.main.media-item.123 /local/download/image.jpg
|
|
322
|
+
|
|
323
|
+
# Download original version
|
|
324
|
+
pltr media-sets download ri.mediasets.main.media-set.abc \
|
|
325
|
+
ri.mediasets.main.media-item.123 /local/download/original.jpg --original
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**All MediaSets commands support:**
|
|
329
|
+
- Multiple output formats (table, JSON, CSV)
|
|
330
|
+
- File output (`--output filename`)
|
|
331
|
+
- Profile selection (`--profile production`)
|
|
332
|
+
- Preview mode (`--preview`)
|
|
333
|
+
- Transaction-based upload workflow
|
|
334
|
+
|
|
335
|
+
### 📊 Dataset Transaction Management
|
|
336
|
+
|
|
337
|
+
pltr-cli provides comprehensive transaction management for datasets, allowing atomic operations with rollback capability:
|
|
338
|
+
|
|
339
|
+
#### Transaction Lifecycle
|
|
340
|
+
```bash
|
|
341
|
+
# Start a new transaction
|
|
342
|
+
pltr dataset transactions start ri.foundry.main.dataset.abc123 --branch master --type APPEND
|
|
343
|
+
# Returns transaction RID for use in subsequent operations
|
|
344
|
+
|
|
345
|
+
# Check transaction status
|
|
346
|
+
pltr dataset transactions status ri.foundry.main.dataset.abc123 ri.foundry.main.transaction.xyz
|
|
347
|
+
|
|
348
|
+
# List all transactions for a dataset
|
|
349
|
+
pltr dataset transactions list ri.foundry.main.dataset.abc123 --branch master
|
|
350
|
+
|
|
351
|
+
# Commit a transaction (make changes permanent)
|
|
352
|
+
pltr dataset transactions commit ri.foundry.main.dataset.abc123 ri.foundry.main.transaction.xyz
|
|
353
|
+
|
|
354
|
+
# Abort a transaction (discard all changes)
|
|
355
|
+
pltr dataset transactions abort ri.foundry.main.dataset.abc123 ri.foundry.main.transaction.xyz --yes
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
#### File Operations with Transactions
|
|
359
|
+
```bash
|
|
360
|
+
# Upload files within a transaction
|
|
361
|
+
pltr dataset files upload data.csv ri.foundry.main.dataset.abc123 \
|
|
362
|
+
--transaction-rid ri.foundry.main.transaction.xyz
|
|
363
|
+
|
|
364
|
+
# Multiple file uploads in same transaction
|
|
365
|
+
pltr dataset files upload file1.csv ri.foundry.main.dataset.abc123 \
|
|
366
|
+
--transaction-rid ri.foundry.main.transaction.xyz
|
|
367
|
+
pltr dataset files upload file2.csv ri.foundry.main.dataset.abc123 \
|
|
368
|
+
--transaction-rid ri.foundry.main.transaction.xyz
|
|
369
|
+
|
|
370
|
+
# Commit when ready
|
|
371
|
+
pltr dataset transactions commit ri.foundry.main.dataset.abc123 ri.foundry.main.transaction.xyz
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
#### Transaction Types
|
|
375
|
+
- **APPEND**: Add new files to dataset
|
|
376
|
+
- **UPDATE**: Add new files and overwrite existing ones
|
|
377
|
+
- **SNAPSHOT**: Replace entire dataset with new files
|
|
378
|
+
- **DELETE**: Remove files from dataset
|
|
379
|
+
|
|
380
|
+
#### Example Workflow
|
|
381
|
+
```bash
|
|
382
|
+
# Start a transaction for bulk data update
|
|
383
|
+
TRANSACTION=$(pltr dataset transactions start ri.foundry.main.dataset.abc123 \
|
|
384
|
+
--type UPDATE --format json | jq -r '.transaction_rid')
|
|
385
|
+
|
|
386
|
+
# Upload multiple files
|
|
387
|
+
pltr dataset files upload data1.csv ri.foundry.main.dataset.abc123 --transaction-rid $TRANSACTION
|
|
388
|
+
pltr dataset files upload data2.csv ri.foundry.main.dataset.abc123 --transaction-rid $TRANSACTION
|
|
389
|
+
|
|
390
|
+
# Check status before committing
|
|
391
|
+
pltr dataset transactions status ri.foundry.main.dataset.abc123 $TRANSACTION
|
|
392
|
+
|
|
393
|
+
# Commit if everything looks good
|
|
394
|
+
pltr dataset transactions commit ri.foundry.main.dataset.abc123 $TRANSACTION
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**Benefits:**
|
|
398
|
+
- **Data Integrity**: Atomic operations with rollback capability
|
|
399
|
+
- **Error Recovery**: Clean rollback from failed operations
|
|
400
|
+
- **Collaboration**: Better concurrent modification handling
|
|
401
|
+
- **Automation**: Reliable data pipeline operations
|
|
402
|
+
|
|
403
|
+
## ⚙️ Configuration
|
|
404
|
+
|
|
405
|
+
pltr-cli stores configuration securely using industry best practices:
|
|
406
|
+
|
|
407
|
+
- **Profile Configuration**: `~/.config/pltr/profiles.json`
|
|
408
|
+
- **Credentials**: Encrypted in system keyring (never stored in plain text)
|
|
409
|
+
- **Shell History**: `~/.config/pltr/repl_history` (for interactive mode)
|
|
410
|
+
|
|
411
|
+
### Environment Variables
|
|
412
|
+
|
|
413
|
+
For CI/CD and automation, use environment variables:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Token authentication
|
|
417
|
+
export FOUNDRY_TOKEN="your-api-token"
|
|
418
|
+
export FOUNDRY_HOST="foundry.company.com"
|
|
419
|
+
|
|
420
|
+
# OAuth2 authentication
|
|
421
|
+
export FOUNDRY_CLIENT_ID="your-client-id"
|
|
422
|
+
export FOUNDRY_CLIENT_SECRET="your-client-secret"
|
|
423
|
+
export FOUNDRY_HOST="foundry.company.com"
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
See **[Authentication Setup](docs/user-guide/authentication.md)** for complete configuration options.
|
|
427
|
+
|
|
428
|
+
## 🔧 Development
|
|
429
|
+
|
|
430
|
+
### Prerequisites
|
|
431
|
+
|
|
432
|
+
- Python 3.9+
|
|
433
|
+
- [uv](https://github.com/astral-sh/uv) for dependency management
|
|
434
|
+
|
|
435
|
+
### Quick Development Setup
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
# Clone the repository
|
|
439
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
440
|
+
cd pltr-cli
|
|
441
|
+
|
|
442
|
+
# Install dependencies and development tools
|
|
443
|
+
uv sync
|
|
444
|
+
|
|
445
|
+
# Install pre-commit hooks
|
|
446
|
+
uv run pre-commit install
|
|
447
|
+
|
|
448
|
+
# Run tests
|
|
449
|
+
uv run pytest
|
|
450
|
+
|
|
451
|
+
# Run linting and formatting
|
|
452
|
+
uv run ruff check src/
|
|
453
|
+
uv run ruff format src/
|
|
454
|
+
uv run mypy src/
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Project Architecture
|
|
458
|
+
|
|
459
|
+
pltr-cli uses a layered architecture:
|
|
460
|
+
|
|
461
|
+
- **CLI Layer** (Typer): Command-line interface and argument parsing
|
|
462
|
+
- **Command Layer**: Command implementations with validation
|
|
463
|
+
- **Service Layer**: Business logic and foundry-platform-sdk integration
|
|
464
|
+
- **Auth Layer**: Secure authentication and credential management
|
|
465
|
+
- **Utils Layer**: Formatting, progress, and helper functions
|
|
466
|
+
|
|
467
|
+
See **[API Wrapper Documentation](docs/api/wrapper.md)** for detailed architecture information and extension guides.
|
|
468
|
+
|
|
469
|
+
## 📊 Current Status
|
|
470
|
+
|
|
471
|
+
pltr-cli is **production-ready** with comprehensive features:
|
|
472
|
+
|
|
473
|
+
- ✅ **80+ Commands** across 10 command groups
|
|
474
|
+
- ✅ **273 Unit Tests** with 67% code coverage
|
|
475
|
+
- ✅ **Published on PyPI** with automated releases
|
|
476
|
+
- ✅ **Cross-Platform** support (Windows, macOS, Linux)
|
|
477
|
+
- ✅ **Comprehensive Documentation** (Quick start, guides, examples)
|
|
478
|
+
- ✅ **Interactive Shell** with tab completion and history
|
|
479
|
+
- ✅ **CI/CD Ready** with environment variable support
|
|
480
|
+
|
|
481
|
+
**Latest Release**: Available on [PyPI](https://pypi.org/project/pltr-cli/)
|
|
482
|
+
|
|
483
|
+
## 🤝 Contributing
|
|
484
|
+
|
|
485
|
+
Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation.
|
|
486
|
+
|
|
487
|
+
### Getting Started
|
|
488
|
+
|
|
489
|
+
1. Fork the repository
|
|
490
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
491
|
+
3. Make your changes following the existing patterns
|
|
492
|
+
4. Add tests for new functionality
|
|
493
|
+
5. Run the test suite and linting
|
|
494
|
+
6. Commit using conventional commit format (`feat:`, `fix:`, `docs:`, etc.)
|
|
495
|
+
7. Push to your branch and create a Pull Request
|
|
496
|
+
|
|
497
|
+
### Development Guidelines
|
|
498
|
+
|
|
499
|
+
- Follow existing code patterns and architecture
|
|
500
|
+
- Add tests for new functionality
|
|
501
|
+
- Update documentation for user-facing changes
|
|
502
|
+
- Use type hints throughout
|
|
503
|
+
- Follow the existing error handling patterns
|
|
504
|
+
|
|
505
|
+
See **[API Wrapper Documentation](docs/api/wrapper.md)** for detailed development guidelines.
|
|
506
|
+
|
|
507
|
+
## License
|
|
508
|
+
|
|
509
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
510
|
+
|
|
511
|
+
## Acknowledgments
|
|
512
|
+
|
|
513
|
+
Built on top of the official [Palantir Foundry Platform Python SDK](https://github.com/palantir/foundry-platform-python).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
pltr/__init__.py,sha256=
|
|
1
|
+
pltr/__init__.py,sha256=LBK46heutvn3KmsCrKIYu8RQikbfnjZaj2xFrXaeCzQ,22
|
|
2
2
|
pltr/__main__.py,sha256=HWJ49UoAYBQCf8kjuySPmBTuUjTZrOx-y6PzMTyS1KE,879
|
|
3
|
-
pltr/cli.py,sha256=
|
|
3
|
+
pltr/cli.py,sha256=DikRsWsU7QWvRWHgB6wZIct916ebWyaub7PlAjKJXws,2664
|
|
4
4
|
pltr/auth/__init__.py,sha256=G0V-Rh25FaJsH2nhrf146XQQG_ApdbyPJNuHJC25kgk,38
|
|
5
5
|
pltr/auth/base.py,sha256=LvmCwS7A0q0CITcym8udPzdACL52_jSGusiaeCTOaE8,981
|
|
6
6
|
pltr/auth/manager.py,sha256=ZqlGefr1a8MGx0g7kkQhpmiuVp0XTg3f43yMBCk-IRo,4305
|
|
@@ -12,10 +12,17 @@ pltr/commands/admin.py,sha256=foscSO-QuH6uggUR5Rmv9pTqGjEXTUzpmMFj2-8hEJs,17065
|
|
|
12
12
|
pltr/commands/alias.py,sha256=r9xMsQNrGvaixSlspzoO2IXQ44LFXuZM4itt8vC0dRc,6862
|
|
13
13
|
pltr/commands/completion.py,sha256=YTxaRL4-rDs5n7aXf3ogFsxbHVJUBo_HiBbd0fbBPZ0,10870
|
|
14
14
|
pltr/commands/configure.py,sha256=oYj-VlOEj3MDwtB2RC4bYOYzI_sXTanPnz7y1GmMTqY,4800
|
|
15
|
-
pltr/commands/
|
|
15
|
+
pltr/commands/connectivity.py,sha256=m8_BYwHij_5IbrYFTU_SYYtbqLCjxA8VIQpbdlWJqHs,14758
|
|
16
|
+
pltr/commands/dataset.py,sha256=6NiFnWkV_Tkx9AunV-dns6BeR_BBUNMg4tOocBBxaqI,24188
|
|
16
17
|
pltr/commands/folder.py,sha256=IAPPA3Smk1IWqThneEtZ08Zp79vDKVUabSkL_nDvUWk,10679
|
|
18
|
+
pltr/commands/mediasets.py,sha256=FXq7OtYU9wLgUxQFcS_fkA4i_CozGnsYKxh8GOSI0ok,15342
|
|
17
19
|
pltr/commands/ontology.py,sha256=zUgSrmv8xi26SQK7GsM3qusgR9Wuka0GyzE7L8DkduE,18317
|
|
20
|
+
pltr/commands/orchestration.py,sha256=4gq5nb43bU0Ub3iaKV-EgXT_ka8ilwdyxY_9M5iS84s,21958
|
|
21
|
+
pltr/commands/project.py,sha256=nlfyy4OYkYK9rtjOQp9awgCnSJ1P6sgsp0vaXdvkHFY,14183
|
|
22
|
+
pltr/commands/resource.py,sha256=VQsDSdeHlLoind34DU9dKu13tqSvsCUtYzxwDYULXSA,16384
|
|
23
|
+
pltr/commands/resource_role.py,sha256=pM0DQxLBU9xyIYzLv1Y0sOMZG5oZ1INNSkMubYBGHJM,15394
|
|
18
24
|
pltr/commands/shell.py,sha256=QLF7TEGpaau9i0A9s3VjnegvtHde-SLRqI4suJFT4WI,3622
|
|
25
|
+
pltr/commands/space.py,sha256=R9TN9OQVDtFB92DOjrh81_YYajiQaqRNELsBHK4O-pI,21944
|
|
19
26
|
pltr/commands/sql.py,sha256=wol0Rlvi_RplCFbOg4LCa3VXsOqmRZdFFVv7V6iVkh8,12602
|
|
20
27
|
pltr/commands/verify.py,sha256=n8LWhbfGieYa-a5_l3MxqkYbdpyVf8-i0FQIL__AaPA,6650
|
|
21
28
|
pltr/config/__init__.py,sha256=Y6gARy5lUHy-OJaOUxtfXoeQVNZV5QHLl6uKHQ8tpTk,41
|
|
@@ -25,19 +32,24 @@ pltr/config/settings.py,sha256=bfIiosPqH_W73TOHS71DvgZdAHka4fJDopU1SvBRFuQ,2908
|
|
|
25
32
|
pltr/services/__init__.py,sha256=zQpgrqPdAkZI-nobi33mctU2-iGNgazzvjBVY8YRbSQ,101
|
|
26
33
|
pltr/services/admin.py,sha256=8FjExmDeIKeVqkAxM83SVvpp_pH9W-Q33cgVs6BHxLQ,9957
|
|
27
34
|
pltr/services/base.py,sha256=R2G781FI-sXtjUyLd91bVnmLb4cYZI3G8U5ndR9NLA4,1593
|
|
28
|
-
pltr/services/
|
|
29
|
-
pltr/services/
|
|
30
|
-
pltr/services/dataset_v2.py,sha256=_uhcVJ91w_Y07glceqHceccAwPWr6q1TWSIqcP1FU8I,4259
|
|
35
|
+
pltr/services/connectivity.py,sha256=34kazXhue5gNi1_2s2R5Ma4VQe6jP25CO-ztiPhCeZw,10548
|
|
36
|
+
pltr/services/dataset.py,sha256=L_SZ0yFIq3Zlx_eHtOwpRYZcUh1xGG7pIlbCRnYjrbs,25175
|
|
31
37
|
pltr/services/folder.py,sha256=mWElyvn-wXPB5sv8Ik_dLeW5JM6jZg3g9KKBk6UcrlQ,5389
|
|
38
|
+
pltr/services/mediasets.py,sha256=HgHNFWoG9r-5xupANVOxHg_h5EKsBDl6PsO8hwdbm28,9854
|
|
32
39
|
pltr/services/ontology.py,sha256=iW7qRK8ptlw-u4eAwLNC-mdzLoLZzh7SRqJyok2c3GU,14883
|
|
40
|
+
pltr/services/orchestration.py,sha256=t5RNC0BoKcqeYKJQ5AQAyyO_dIYCHxiHV177JVSszhM,14729
|
|
41
|
+
pltr/services/project.py,sha256=nwLXBX0MWgOnVQ7CAZQHnzZtSJY_hqlGyooFngQSjcc,7740
|
|
42
|
+
pltr/services/resource.py,sha256=hX1DX5ZoVx8-ZImBitHqgMS8Ver022RoMbd4ZvCt-fA,9603
|
|
43
|
+
pltr/services/resource_role.py,sha256=Ootor16c6PR9TNxe6KJyd4W2lYM_HHDxJk-JvZhgRxU,10608
|
|
44
|
+
pltr/services/space.py,sha256=4uea1nQ6CA-6_xWoD6n49E4Zm6KbW_7Cq9o89JorMTE,11544
|
|
33
45
|
pltr/services/sql.py,sha256=19cscjlzN8WE1s8_ctiRcrOvMzCfmWRj49vjJ8Gs5Q4,11286
|
|
34
46
|
pltr/utils/__init__.py,sha256=DF7TigL1XbKVGM5VjgU8_8AGIszofkdO80oCzLGGnTE,38
|
|
35
47
|
pltr/utils/alias_resolver.py,sha256=DIF7P1UnUU8kqocJfIDEWjYq4s8_0KfqRZBbECeZEh8,1539
|
|
36
48
|
pltr/utils/completion.py,sha256=bjeqjleEfB2YcQFpcxvF0GoQ763F6KBbULSZC4FWY_g,4980
|
|
37
|
-
pltr/utils/formatting.py,sha256=
|
|
49
|
+
pltr/utils/formatting.py,sha256=MuIgi8dSqvhzik7H0YQOq1sYPnY_poZOYeTVvrIY2Jk,44235
|
|
38
50
|
pltr/utils/progress.py,sha256=BKYbiLO61uhQbibabU7pxvvbAWMRLRmqk4pZldBQK_g,9053
|
|
39
|
-
pltr_cli-0.
|
|
40
|
-
pltr_cli-0.
|
|
41
|
-
pltr_cli-0.
|
|
42
|
-
pltr_cli-0.
|
|
43
|
-
pltr_cli-0.
|
|
51
|
+
pltr_cli-0.5.1.dist-info/METADATA,sha256=eQiiY1B0njuRJbz5-rFJ9qsFkeIwVD2aPmGHIPmajhY,17714
|
|
52
|
+
pltr_cli-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
53
|
+
pltr_cli-0.5.1.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
|
|
54
|
+
pltr_cli-0.5.1.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
|
|
55
|
+
pltr_cli-0.5.1.dist-info/RECORD,,
|