pltr-cli 0.6.0__tar.gz → 0.7.0__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 (129) hide show
  1. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/CLAUDE.md +7 -4
  2. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/PKG-INFO +1 -1
  3. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/examples/csv-upload.md +136 -1
  4. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/pyproject.toml +1 -1
  5. pltr_cli-0.7.0/src/pltr/__init__.py +1 -0
  6. pltr_cli-0.7.0/src/pltr/commands/dataset.py +1433 -0
  7. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/dataset.py +537 -0
  8. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/utils/formatting.py +170 -0
  9. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_dataset.py +209 -0
  10. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/uv.lock +1 -1
  11. pltr_cli-0.6.0/src/pltr/__init__.py +0 -1
  12. pltr_cli-0.6.0/src/pltr/commands/dataset.py +0 -692
  13. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/.github/workflows/ci.yml +0 -0
  14. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/.github/workflows/publish.yml +0 -0
  15. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/.github/workflows/test-publish.yml +0 -0
  16. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/.gitignore +0 -0
  17. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/.pre-commit-config.yaml +0 -0
  18. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/CHANGELOG.md +0 -0
  19. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/LICENSE +0 -0
  20. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/README.md +0 -0
  21. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/RELEASE.md +0 -0
  22. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/children.csv +0 -0
  23. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/README.md +0 -0
  24. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/api/wrapper.md +0 -0
  25. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/examples/gallery.md +0 -0
  26. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/features/dataset-transactions.md +0 -0
  27. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/aliases.md +0 -0
  28. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/authentication.md +0 -0
  29. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/commands.md +0 -0
  30. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/quick-start.md +0 -0
  31. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/troubleshooting.md +0 -0
  32. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/docs/user-guide/workflows.md +0 -0
  33. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/folder_info.json +0 -0
  34. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/folders.json +0 -0
  35. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/mypy.ini +0 -0
  36. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/scripts/release.py +0 -0
  37. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/__main__.py +0 -0
  38. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/__init__.py +0 -0
  39. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/base.py +0 -0
  40. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/manager.py +0 -0
  41. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/oauth.py +0 -0
  42. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/storage.py +0 -0
  43. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/auth/token.py +0 -0
  44. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/cli.py +0 -0
  45. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/__init__.py +0 -0
  46. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/admin.py +0 -0
  47. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/alias.py +0 -0
  48. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/completion.py +0 -0
  49. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/configure.py +0 -0
  50. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/connectivity.py +0 -0
  51. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/folder.py +0 -0
  52. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/mediasets.py +0 -0
  53. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/ontology.py +0 -0
  54. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/orchestration.py +0 -0
  55. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/project.py +0 -0
  56. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/resource.py +0 -0
  57. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/resource_role.py +0 -0
  58. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/shell.py +0 -0
  59. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/space.py +0 -0
  60. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/sql.py +0 -0
  61. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/commands/verify.py +0 -0
  62. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/config/__init__.py +0 -0
  63. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/config/aliases.py +0 -0
  64. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/config/profiles.py +0 -0
  65. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/config/settings.py +0 -0
  66. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/__init__.py +0 -0
  67. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/admin.py +0 -0
  68. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/base.py +0 -0
  69. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/connectivity.py +0 -0
  70. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/folder.py +0 -0
  71. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/mediasets.py +0 -0
  72. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/ontology.py +0 -0
  73. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/orchestration.py +0 -0
  74. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/project.py +0 -0
  75. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/resource.py +0 -0
  76. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/resource_role.py +0 -0
  77. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/space.py +0 -0
  78. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/services/sql.py +0 -0
  79. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/utils/__init__.py +0 -0
  80. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/utils/alias_resolver.py +0 -0
  81. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/utils/completion.py +0 -0
  82. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/src/pltr/utils/progress.py +0 -0
  83. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/__init__.py +0 -0
  84. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/conftest.py +0 -0
  85. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/README.md +0 -0
  86. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/__init__.py +0 -0
  87. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/conftest.py +0 -0
  88. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/test_auth_flow.py +0 -0
  89. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/test_cli_integration.py +0 -0
  90. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/test_data_workflows.py +0 -0
  91. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/test_data_workflows_simple.py +0 -0
  92. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/integration/test_simple_integration.py +0 -0
  93. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/__init__.py +0 -0
  94. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/test_base.py +0 -0
  95. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/test_manager.py +0 -0
  96. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/test_oauth.py +0 -0
  97. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/test_storage.py +0 -0
  98. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_auth/test_token.py +0 -0
  99. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/__init__.py +0 -0
  100. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_admin.py +0 -0
  101. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_alias.py +0 -0
  102. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_completion.py +0 -0
  103. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_connectivity.py +0 -0
  104. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_dataset.py +0 -0
  105. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_folder.py +0 -0
  106. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_ontology.py +0 -0
  107. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_orchestration.py +0 -0
  108. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_shell.py +0 -0
  109. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_sql.py +0 -0
  110. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_commands/test_verify_simple.py +0 -0
  111. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_config/__init__.py +0 -0
  112. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_config/test_aliases.py +0 -0
  113. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_config/test_profiles.py +0 -0
  114. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_config/test_settings.py +0 -0
  115. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/__init__.py +0 -0
  116. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_admin.py +0 -0
  117. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_base.py +0 -0
  118. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_connectivity.py +0 -0
  119. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_dataset_transactions.py +0 -0
  120. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_folder.py +0 -0
  121. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_ontology.py +0 -0
  122. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_orchestration.py +0 -0
  123. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_project.py +0 -0
  124. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_resource.py +0 -0
  125. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_resource_role.py +0 -0
  126. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_space.py +0 -0
  127. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_services/test_sql.py +0 -0
  128. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_utils/__init__.py +0 -0
  129. {pltr_cli-0.6.0 → pltr_cli-0.7.0}/tests/test_utils/test_alias_resolver.py +0 -0
@@ -1,10 +1,13 @@
1
1
  ## Development tips
2
2
 
3
- The basis of the SDK is https://github.com/palantir/foundry-platform-python . This is a
4
- CLI that wraps around the SDK to give a CLI interface.
3
+ The basis of the SDK is https://github.com/palantir/foundry-platform-python. Their main
4
+ branch is develop and not main.
5
+ This project is a CLI that wraps around the SDK to give a CLI interface.
5
6
 
6
- Use uv for dependency management.
7
- Use uv to run python scripts.
7
+ ## Python guidance
8
+
9
+ - ALWAYS Use uv for dependency management.
10
+ - ALWAYS Use uv to run python scripts.
8
11
 
9
12
  ## General Guidance
10
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pltr-cli
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Command-line interface for Palantir Foundry APIs
5
5
  Project-URL: Homepage, https://github.com/anjor/pltr-cli
6
6
  Project-URL: Repository, https://github.com/anjor/pltr-cli
@@ -46,6 +46,12 @@ echo "Committing transaction..."
46
46
  pltr dataset transaction commit "$DATASET_RID" "$TRANSACTION_RID"
47
47
 
48
48
  echo "✅ CSV uploaded successfully to dataset: $DATASET_RID"
49
+
50
+ # Set the schema based on CSV headers (NEW!)
51
+ echo "Setting dataset schema from CSV..."
52
+ pltr dataset schema set "$DATASET_RID" --from-csv "$CSV_FILE"
53
+
54
+ echo "✅ Schema set successfully"
49
55
  ```
50
56
 
51
57
  ### Step 2: Verify Upload
@@ -57,7 +63,10 @@ pltr dataset get "$DATASET_RID"
57
63
  # List files in dataset
58
64
  pltr dataset files list "$DATASET_RID"
59
65
 
60
- # Query the data (if it's queryable)
66
+ # Check the schema (NEW!)
67
+ pltr dataset schema get "$DATASET_RID"
68
+
69
+ # Query the data (now with proper types!)
61
70
  pltr sql execute "SELECT COUNT(*) as row_count FROM \`$DATASET_RID\`"
62
71
  ```
63
72
 
@@ -140,6 +149,114 @@ pltr dataset transaction commit "$DATASET_RID" "$TRANSACTION_RID" \
140
149
  echo "✅ Dataset updated successfully"
141
150
  ```
142
151
 
152
+ ## 🔧 Schema Management for CSV Datasets
153
+
154
+ ### Automatic Schema Inference
155
+
156
+ When uploading CSV files, pltr-cli can automatically infer the schema from your CSV headers and data:
157
+
158
+ ```bash
159
+ #!/bin/bash
160
+ # infer_schema.sh - Automatically set schema from CSV
161
+
162
+ CSV_FILE="sales_data.csv"
163
+ DATASET_RID="ri.foundry.main.dataset.your-dataset-rid"
164
+
165
+ # Infer and set schema from CSV
166
+ pltr dataset schema set "$DATASET_RID" --from-csv "$CSV_FILE"
167
+
168
+ # View the inferred schema
169
+ pltr dataset schema get "$DATASET_RID" --format json
170
+ ```
171
+
172
+ The schema inference will:
173
+ - Detect column names from CSV headers
174
+ - Analyze sample rows to determine data types
175
+ - Support types: STRING, INTEGER, DOUBLE, DATE, BOOLEAN, TIMESTAMP
176
+ - Mark columns as nullable if empty values are found
177
+
178
+ ### Manual Schema Definition
179
+
180
+ For precise control, you can define the schema manually:
181
+
182
+ ```bash
183
+ # Define schema using JSON
184
+ SCHEMA_JSON='{
185
+ "fields": [
186
+ {"name": "id", "type": "INTEGER", "nullable": false},
187
+ {"name": "name", "type": "STRING", "nullable": false},
188
+ {"name": "email", "type": "STRING", "nullable": true},
189
+ {"name": "amount", "type": "DOUBLE", "nullable": false},
190
+ {"name": "created_date", "type": "DATE", "nullable": false},
191
+ {"name": "is_active", "type": "BOOLEAN", "nullable": false}
192
+ ]
193
+ }'
194
+
195
+ pltr dataset schema set "$DATASET_RID" --json "$SCHEMA_JSON"
196
+ ```
197
+
198
+ Or load from a JSON file:
199
+
200
+ ```bash
201
+ # schema.json
202
+ cat > schema.json << 'EOF'
203
+ {
204
+ "fields": [
205
+ {"name": "product_id", "type": "INTEGER", "nullable": false},
206
+ {"name": "product_name", "type": "STRING", "nullable": false},
207
+ {"name": "price", "type": "DOUBLE", "nullable": false},
208
+ {"name": "in_stock", "type": "BOOLEAN", "nullable": false},
209
+ {"name": "last_updated", "type": "TIMESTAMP", "nullable": true}
210
+ ]
211
+ }
212
+ EOF
213
+
214
+ pltr dataset schema set "$DATASET_RID" --json-file schema.json
215
+ ```
216
+
217
+ ### Schema-Aware CSV Upload Workflow
218
+
219
+ Here's the complete workflow for uploading CSV with proper schema:
220
+
221
+ ```bash
222
+ #!/bin/bash
223
+ # complete_csv_upload.sh - Upload CSV with schema
224
+
225
+ CSV_FILE="data.csv"
226
+ DATASET_NAME="typed_dataset_$(date +%Y%m%d)"
227
+ PARENT_FOLDER="ri.foundry.main.folder.your-folder-rid"
228
+
229
+ # 1. Create dataset
230
+ DATASET_RID=$(pltr dataset create "$DATASET_NAME" \
231
+ --parent-folder "$PARENT_FOLDER" \
232
+ --format json | jq -r '.rid')
233
+
234
+ # 2. Upload CSV file
235
+ TRANSACTION_RID=$(pltr dataset transaction create "$DATASET_RID" \
236
+ --format json | jq -r '.rid')
237
+
238
+ pltr dataset files upload "$CSV_FILE" "$DATASET_RID" \
239
+ --transaction-rid "$TRANSACTION_RID"
240
+
241
+ pltr dataset transaction commit "$DATASET_RID" "$TRANSACTION_RID"
242
+
243
+ # 3. Set schema from CSV
244
+ pltr dataset schema set "$DATASET_RID" --from-csv "$CSV_FILE"
245
+
246
+ # 4. Verify schema
247
+ echo "Dataset schema:"
248
+ pltr dataset schema get "$DATASET_RID"
249
+
250
+ # 5. Query with proper types
251
+ pltr sql execute "
252
+ SELECT
253
+ COUNT(*) as total_rows,
254
+ AVG(amount) as avg_amount,
255
+ MAX(created_date) as latest_date
256
+ FROM \`$DATASET_RID\`
257
+ "
258
+ ```
259
+
143
260
  ## 📝 CSV with Schema Validation
144
261
 
145
262
  ### Upload with Schema Check
@@ -569,6 +686,24 @@ fi
569
686
  - Use retry logic for uploads
570
687
  - Consider uploading during off-peak hours
571
688
 
689
+ 6. **Schema Issues**
690
+ - **Schema not taking effect**: Ensure the dataset has been created and files uploaded before setting schema
691
+ - **Type inference errors**: Review the first 100 rows of your CSV for inconsistent data
692
+ - **Column name issues**: Schema field names must be valid identifiers (no spaces, special chars)
693
+ - **Query errors after schema**: The schema applies to new data; existing data may need reprocessing
694
+
695
+ ```bash
696
+ # Debug schema issues
697
+ # 1. Check current schema
698
+ pltr dataset schema get <dataset_rid>
699
+
700
+ # 2. Test inference without applying
701
+ pltr dataset schema set <dataset_rid> --from-csv data.csv --dry-run
702
+
703
+ # 3. Verify CSV headers match schema
704
+ head -1 data.csv
705
+ ```
706
+
572
707
  ## 📚 Related Documentation
573
708
 
574
709
  - [Dataset Commands Reference](../user-guide/commands.md#dataset-commands)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pltr-cli"
3
- version = "0.6.0"
3
+ version = "0.7.0"
4
4
  description = "Command-line interface for Palantir Foundry APIs"
5
5
  authors = [
6
6
  { name = "anjor", email = "anjor@umd.edu" },
@@ -0,0 +1 @@
1
+ __version__ = "0.7.0"