pltr-cli 0.1.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 -0
- pltr/auth/__init__.py +1 -0
- pltr/auth/base.py +49 -0
- pltr/auth/manager.py +129 -0
- pltr/auth/oauth.py +83 -0
- pltr/auth/storage.py +87 -0
- pltr/auth/token.py +55 -0
- pltr/cli.py +54 -0
- pltr/commands/__init__.py +1 -0
- pltr/commands/configure.py +151 -0
- pltr/commands/dataset.py +98 -0
- pltr/commands/verify.py +185 -0
- pltr/config/__init__.py +1 -0
- pltr/config/profiles.py +124 -0
- pltr/config/settings.py +103 -0
- pltr/services/__init__.py +1 -0
- pltr/services/base.py +62 -0
- pltr/services/dataset.py +90 -0
- pltr/services/dataset_full.py +302 -0
- pltr/services/dataset_v2.py +128 -0
- pltr/utils/__init__.py +1 -0
- pltr/utils/formatting.py +331 -0
- pltr/utils/progress.py +328 -0
- pltr_cli-0.1.0.dist-info/METADATA +203 -0
- pltr_cli-0.1.0.dist-info/RECORD +28 -0
- pltr_cli-0.1.0.dist-info/WHEEL +4 -0
- pltr_cli-0.1.0.dist-info/entry_points.txt +2 -0
- pltr_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pltr-cli
|
|
3
|
+
Version: 0.1.0
|
|
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: foundry-platform-sdk>=1.27.0
|
|
30
|
+
Requires-Dist: keyring>=25.6.0
|
|
31
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
32
|
+
Requires-Dist: requests>=2.32.4
|
|
33
|
+
Requires-Dist: rich>=14.1.0
|
|
34
|
+
Requires-Dist: typer>=0.16.0
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# pltr-cli
|
|
38
|
+
|
|
39
|
+
A command-line interface tool for interacting with Palantir Foundry APIs.
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
`pltr-cli` provides a streamlined way to interact with Palantir Foundry services from the command line. Built on top of the official `foundry-platform-sdk`, it offers intuitive commands for dataset management, ontology operations, SQL queries, and more.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- 🔐 **Secure Authentication**: Support for both token and OAuth2 authentication with secure credential storage
|
|
48
|
+
- 📊 **Dataset Management**: List, create, upload, and download datasets with progress indicators
|
|
49
|
+
- 🔍 **Ontology Operations**: Search and interact with ontology objects and actions
|
|
50
|
+
- 📝 **SQL Queries**: Execute SQL queries directly from the command line
|
|
51
|
+
- 🎨 **Rich Output**: Beautiful terminal output with table formatting and color support
|
|
52
|
+
- 👤 **Multi-Profile Support**: Manage multiple Foundry environments with profile configurations
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Using pip
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install pltr
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### From source
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Clone the repository
|
|
66
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
67
|
+
cd pltr-cli
|
|
68
|
+
|
|
69
|
+
# Install with uv
|
|
70
|
+
uv sync
|
|
71
|
+
|
|
72
|
+
# Run the CLI
|
|
73
|
+
uv run pltr --help
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
### Configure Authentication
|
|
79
|
+
|
|
80
|
+
Set up your Foundry credentials:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pltr configure --profile production
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This will prompt you for:
|
|
87
|
+
- Foundry host URL
|
|
88
|
+
- Authentication method (token or OAuth2)
|
|
89
|
+
- Credentials
|
|
90
|
+
|
|
91
|
+
### Basic Usage
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# List datasets
|
|
95
|
+
pltr dataset list
|
|
96
|
+
|
|
97
|
+
# Upload a file to a dataset
|
|
98
|
+
pltr dataset upload <dataset-id> path/to/file.csv
|
|
99
|
+
|
|
100
|
+
# Execute a SQL query
|
|
101
|
+
pltr sql execute "SELECT * FROM dataset LIMIT 10"
|
|
102
|
+
|
|
103
|
+
# Search ontology objects
|
|
104
|
+
pltr ontology object search "customer name:John"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Command Reference
|
|
108
|
+
|
|
109
|
+
### Dataset Commands
|
|
110
|
+
|
|
111
|
+
- `pltr dataset list` - List all accessible datasets
|
|
112
|
+
- `pltr dataset get <id>` - Get dataset details
|
|
113
|
+
- `pltr dataset upload <id> <file>` - Upload file to dataset
|
|
114
|
+
- `pltr dataset download <id>` - Download dataset files
|
|
115
|
+
|
|
116
|
+
### Ontology Commands
|
|
117
|
+
|
|
118
|
+
- `pltr ontology object search <query>` - Search for objects
|
|
119
|
+
- `pltr ontology object get <id>` - Get specific object
|
|
120
|
+
- `pltr ontology action execute <action>` - Execute ontology action
|
|
121
|
+
|
|
122
|
+
### SQL Commands
|
|
123
|
+
|
|
124
|
+
- `pltr sql execute <query>` - Execute SQL query
|
|
125
|
+
- `pltr sql export <query> --output <file>` - Export query results
|
|
126
|
+
|
|
127
|
+
### Configuration Commands
|
|
128
|
+
|
|
129
|
+
- `pltr configure` - Set up authentication
|
|
130
|
+
- `pltr configure --profile <name>` - Configure named profile
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
Configuration files are stored in `~/.pltr/`:
|
|
135
|
+
- `~/.pltr/config` - Profile configurations
|
|
136
|
+
- Credentials are stored securely in your system keyring
|
|
137
|
+
|
|
138
|
+
### Environment Variables
|
|
139
|
+
|
|
140
|
+
You can also configure authentication via environment variables:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
export FOUNDRY_HOST=https://your-foundry.palantir.com
|
|
144
|
+
export FOUNDRY_TOKEN=your-token-here
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
### Prerequisites
|
|
150
|
+
|
|
151
|
+
- Python 3.9+
|
|
152
|
+
- [uv](https://github.com/astral-sh/uv) for dependency management
|
|
153
|
+
|
|
154
|
+
### Setup
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Clone the repository
|
|
158
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
159
|
+
cd pltr-cli
|
|
160
|
+
|
|
161
|
+
# Install dependencies
|
|
162
|
+
uv sync
|
|
163
|
+
|
|
164
|
+
# Run tests
|
|
165
|
+
uv run pytest
|
|
166
|
+
|
|
167
|
+
# Format code
|
|
168
|
+
uv run ruff format
|
|
169
|
+
uv run ruff check --fix
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Project Structure
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
pltr-cli/
|
|
176
|
+
├── src/
|
|
177
|
+
│ └── pltr/
|
|
178
|
+
│ ├── cli.py # Main CLI entry point
|
|
179
|
+
│ ├── auth/ # Authentication handling
|
|
180
|
+
│ ├── commands/ # CLI command implementations
|
|
181
|
+
│ ├── services/ # Foundry service wrappers
|
|
182
|
+
│ ├── config/ # Configuration management
|
|
183
|
+
│ └── utils/ # Utilities and helpers
|
|
184
|
+
└── tests/ # Test suite
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Contributing
|
|
188
|
+
|
|
189
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
190
|
+
|
|
191
|
+
1. Fork the repository
|
|
192
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
193
|
+
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
194
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
195
|
+
5. Open a Pull Request
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
200
|
+
|
|
201
|
+
## Acknowledgments
|
|
202
|
+
|
|
203
|
+
Built on top of the official [Palantir Foundry Platform Python SDK](https://github.com/palantir/foundry-platform-python).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
pltr/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
|
+
pltr/cli.py,sha256=lfbVMIvlr1HwSfblEIEr-_Rppe4J1_erydJkv2S4Tk0,1302
|
|
3
|
+
pltr/auth/__init__.py,sha256=G0V-Rh25FaJsH2nhrf146XQQG_ApdbyPJNuHJC25kgk,38
|
|
4
|
+
pltr/auth/base.py,sha256=LvmCwS7A0q0CITcym8udPzdACL52_jSGusiaeCTOaE8,981
|
|
5
|
+
pltr/auth/manager.py,sha256=ZqlGefr1a8MGx0g7kkQhpmiuVp0XTg3f43yMBCk-IRo,4305
|
|
6
|
+
pltr/auth/oauth.py,sha256=uTl5T3MSPlq8Jb3c45hib0vj-GQoyLxmS_NbnKez5dI,2844
|
|
7
|
+
pltr/auth/storage.py,sha256=C7I3-22CJcnrKGNdxk9nXjphsnqQVguT5gNfAnR78Ok,2474
|
|
8
|
+
pltr/auth/token.py,sha256=V48kxGn7CFbNGo17er5oI_ZA3xJ3iS9TsFjphZYqS2s,1925
|
|
9
|
+
pltr/commands/__init__.py,sha256=iOLJ1ql4mz-3-4nz21hAqjd-9IjpYAIxr9SJQKHNFxM,29
|
|
10
|
+
pltr/commands/configure.py,sha256=oYj-VlOEj3MDwtB2RC4bYOYzI_sXTanPnz7y1GmMTqY,4800
|
|
11
|
+
pltr/commands/dataset.py,sha256=igllutiTPeUvKnIErBc2W5_RCGg39SsHN71VSaZ5La8,3250
|
|
12
|
+
pltr/commands/verify.py,sha256=60DE2Tb-uk8D5c2xFswOflks0Y0GAlQKl-tYVBfmbJY,6610
|
|
13
|
+
pltr/config/__init__.py,sha256=Y6gARy5lUHy-OJaOUxtfXoeQVNZV5QHLl6uKHQ8tpTk,41
|
|
14
|
+
pltr/config/profiles.py,sha256=XMUIp6Ez5LNC6rGXZe2JLH7IKepXhARtuc8ASUA9FYA,3431
|
|
15
|
+
pltr/config/settings.py,sha256=bfIiosPqH_W73TOHS71DvgZdAHka4fJDopU1SvBRFuQ,2908
|
|
16
|
+
pltr/services/__init__.py,sha256=dZeDOZkXHXx16OJwzqfgII-MjODLb5s1cDxlIh2utEQ,40
|
|
17
|
+
pltr/services/base.py,sha256=R2G781FI-sXtjUyLd91bVnmLb4cYZI3G8U5ndR9NLA4,1593
|
|
18
|
+
pltr/services/dataset.py,sha256=W3zoh-9YIJ6HBsDijejVEngKvpudFoZinYtHDmAXCOc,2785
|
|
19
|
+
pltr/services/dataset_full.py,sha256=FyMiwOSyX1cUrYXaK0T_1iq5G_X0e5iZTibJHuEmMeE,9869
|
|
20
|
+
pltr/services/dataset_v2.py,sha256=_uhcVJ91w_Y07glceqHceccAwPWr6q1TWSIqcP1FU8I,4259
|
|
21
|
+
pltr/utils/__init__.py,sha256=DF7TigL1XbKVGM5VjgU8_8AGIszofkdO80oCzLGGnTE,38
|
|
22
|
+
pltr/utils/formatting.py,sha256=UhUch5SAOOb8l3nx2CcNQmMuzhbvo0WqqmVppYNkXoU,11105
|
|
23
|
+
pltr/utils/progress.py,sha256=6ayZ6s4z9wJ3rcS_ILmeuOe_iLRBXN6DU1AYGmgpBwU,9055
|
|
24
|
+
pltr_cli-0.1.0.dist-info/METADATA,sha256=iCbd94Do5dCxHHxMJIrmP8Zseahw_Pj9n4s1RxqXKyU,5744
|
|
25
|
+
pltr_cli-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
pltr_cli-0.1.0.dist-info/entry_points.txt,sha256=8tvEcW04kA_oAE2Dwwu-Og9efjl4ESJvs4AzlP2KBdQ,38
|
|
27
|
+
pltr_cli-0.1.0.dist-info/licenses/LICENSE,sha256=6VUFd_ytnOBD2O1tmkKrA-smigi9QEhYr_tge4h4z8Y,1070
|
|
28
|
+
pltr_cli-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Anjor Kanekar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|