pltr-cli 0.1.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 (53) hide show
  1. pltr_cli-0.1.0/.github/workflows/ci.yml +80 -0
  2. pltr_cli-0.1.0/.github/workflows/publish.yml +129 -0
  3. pltr_cli-0.1.0/.github/workflows/test-publish.yml +141 -0
  4. pltr_cli-0.1.0/.gitignore +148 -0
  5. pltr_cli-0.1.0/CLAUDE.md +15 -0
  6. pltr_cli-0.1.0/DEVELOPMENT_PLAN.md +346 -0
  7. pltr_cli-0.1.0/LICENSE +21 -0
  8. pltr_cli-0.1.0/PKG-INFO +203 -0
  9. pltr_cli-0.1.0/README.md +167 -0
  10. pltr_cli-0.1.0/mypy.ini +12 -0
  11. pltr_cli-0.1.0/pyproject.toml +62 -0
  12. pltr_cli-0.1.0/scripts/release.py +211 -0
  13. pltr_cli-0.1.0/src/pltr/__init__.py +1 -0
  14. pltr_cli-0.1.0/src/pltr/auth/__init__.py +1 -0
  15. pltr_cli-0.1.0/src/pltr/auth/base.py +49 -0
  16. pltr_cli-0.1.0/src/pltr/auth/manager.py +129 -0
  17. pltr_cli-0.1.0/src/pltr/auth/oauth.py +83 -0
  18. pltr_cli-0.1.0/src/pltr/auth/storage.py +87 -0
  19. pltr_cli-0.1.0/src/pltr/auth/token.py +55 -0
  20. pltr_cli-0.1.0/src/pltr/cli.py +54 -0
  21. pltr_cli-0.1.0/src/pltr/commands/__init__.py +1 -0
  22. pltr_cli-0.1.0/src/pltr/commands/configure.py +151 -0
  23. pltr_cli-0.1.0/src/pltr/commands/dataset.py +98 -0
  24. pltr_cli-0.1.0/src/pltr/commands/verify.py +185 -0
  25. pltr_cli-0.1.0/src/pltr/config/__init__.py +1 -0
  26. pltr_cli-0.1.0/src/pltr/config/profiles.py +124 -0
  27. pltr_cli-0.1.0/src/pltr/config/settings.py +103 -0
  28. pltr_cli-0.1.0/src/pltr/services/__init__.py +1 -0
  29. pltr_cli-0.1.0/src/pltr/services/base.py +62 -0
  30. pltr_cli-0.1.0/src/pltr/services/dataset.py +90 -0
  31. pltr_cli-0.1.0/src/pltr/services/dataset_full.py +302 -0
  32. pltr_cli-0.1.0/src/pltr/services/dataset_v2.py +128 -0
  33. pltr_cli-0.1.0/src/pltr/utils/__init__.py +1 -0
  34. pltr_cli-0.1.0/src/pltr/utils/formatting.py +331 -0
  35. pltr_cli-0.1.0/src/pltr/utils/progress.py +328 -0
  36. pltr_cli-0.1.0/tests/__init__.py +1 -0
  37. pltr_cli-0.1.0/tests/conftest.py +118 -0
  38. pltr_cli-0.1.0/tests/test_auth/__init__.py +0 -0
  39. pltr_cli-0.1.0/tests/test_auth/test_base.py +74 -0
  40. pltr_cli-0.1.0/tests/test_auth/test_manager.py +260 -0
  41. pltr_cli-0.1.0/tests/test_auth/test_oauth.py +171 -0
  42. pltr_cli-0.1.0/tests/test_auth/test_storage.py +159 -0
  43. pltr_cli-0.1.0/tests/test_auth/test_token.py +129 -0
  44. pltr_cli-0.1.0/tests/test_commands/__init__.py +0 -0
  45. pltr_cli-0.1.0/tests/test_commands/test_dataset.py +198 -0
  46. pltr_cli-0.1.0/tests/test_commands/test_verify_simple.py +95 -0
  47. pltr_cli-0.1.0/tests/test_config/__init__.py +0 -0
  48. pltr_cli-0.1.0/tests/test_config/test_profiles.py +212 -0
  49. pltr_cli-0.1.0/tests/test_config/test_settings.py +202 -0
  50. pltr_cli-0.1.0/tests/test_services/__init__.py +1 -0
  51. pltr_cli-0.1.0/tests/test_services/test_base.py +133 -0
  52. pltr_cli-0.1.0/tests/test_services/test_dataset.py +247 -0
  53. pltr_cli-0.1.0/uv.lock +1056 -0
@@ -0,0 +1,80 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest, windows-latest]
15
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+ with:
23
+ version: "latest"
24
+
25
+ - name: Set up Python ${{ matrix.python-version }}
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ uv sync --dev
33
+
34
+ - name: Run linting with ruff
35
+ run: |
36
+ uv run ruff check .
37
+
38
+ - name: Run type checking with mypy
39
+ run: |
40
+ uv run mypy src/pltr
41
+
42
+ - name: Run tests with coverage
43
+ run: |
44
+ uv run pytest --cov=pltr --cov-report=xml --cov-report=term
45
+
46
+ - name: Upload coverage to Codecov
47
+ uses: codecov/codecov-action@v4
48
+ with:
49
+ file: ./coverage.xml
50
+ fail_ci_if_error: false
51
+ token: ${{ secrets.CODECOV_TOKEN }}
52
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
53
+
54
+ lint-and-format:
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+
59
+ - name: Install uv
60
+ uses: astral-sh/setup-uv@v3
61
+ with:
62
+ version: "latest"
63
+
64
+ - name: Set up Python
65
+ uses: actions/setup-python@v5
66
+ with:
67
+ python-version: "3.11"
68
+
69
+ - name: Install dependencies
70
+ run: |
71
+ uv sync --dev
72
+
73
+ - name: Check code formatting with ruff
74
+ run: |
75
+ uv run ruff format --check .
76
+
77
+ - name: Run security checks (if configured)
78
+ run: |
79
+ # Add security scanning tools here if needed
80
+ echo "Security checks placeholder - add tools like bandit, safety, etc."
@@ -0,0 +1,129 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ version:
10
+ description: 'Version to publish (e.g., v0.1.0)'
11
+ required: true
12
+ type: string
13
+
14
+ jobs:
15
+ build:
16
+ name: Build distribution
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v3
24
+ with:
25
+ version: "latest"
26
+ enable-cache: true
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.11"
32
+
33
+ - name: Install dependencies
34
+ run: uv sync --dev
35
+
36
+ - name: Run tests
37
+ run: |
38
+ uv run pytest --cov=pltr --cov-report=xml --cov-report=term
39
+
40
+ - name: Run linting
41
+ run: |
42
+ uv run ruff check .
43
+ uv run ruff format --check .
44
+
45
+ - name: Run type checking
46
+ run: |
47
+ uv run mypy src/pltr
48
+
49
+ - name: Build package
50
+ run: |
51
+ uv build --no-sources
52
+
53
+ - name: Upload distribution artifacts
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: python-package-distributions
57
+ path: dist/
58
+ retention-days: 7
59
+
60
+ publish-to-pypi:
61
+ name: Publish to PyPI
62
+ if: startsWith(github.ref, 'refs/tags/')
63
+ needs: build
64
+ runs-on: ubuntu-latest
65
+ environment:
66
+ name: pypi
67
+ url: https://pypi.org/project/pltr-cli/
68
+ permissions:
69
+ id-token: write # IMPORTANT: mandatory for trusted publishing
70
+ steps:
71
+ - name: Download distribution artifacts
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: python-package-distributions
75
+ path: dist/
76
+
77
+ - name: Publish to PyPI
78
+ uses: pypa/gh-action-pypi-publish@release/v1
79
+ with:
80
+ print-hash: true
81
+
82
+ github-release:
83
+ name: Create GitHub Release
84
+ needs: [build, publish-to-pypi]
85
+ if: startsWith(github.ref, 'refs/tags/')
86
+ runs-on: ubuntu-latest
87
+ permissions:
88
+ contents: write
89
+ id-token: write
90
+ steps:
91
+ - name: Checkout code
92
+ uses: actions/checkout@v4
93
+
94
+ - name: Download distribution artifacts
95
+ uses: actions/download-artifact@v4
96
+ with:
97
+ name: python-package-distributions
98
+ path: dist/
99
+
100
+ - name: Sign the dists with Sigstore
101
+ uses: sigstore/gh-action-sigstore-python@v2.1.1
102
+ with:
103
+ inputs: >-
104
+ ./dist/*.tar.gz
105
+ ./dist/*.whl
106
+
107
+ - name: Extract version from tag
108
+ id: version
109
+ run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
110
+
111
+ - name: Generate changelog
112
+ id: changelog
113
+ run: |
114
+ echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
115
+ echo "## Changes in ${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
116
+ echo "" >> $GITHUB_OUTPUT
117
+ echo "See full changes at [GitHub Commits](https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.VERSION }})" >> $GITHUB_OUTPUT
118
+ echo "EOF" >> $GITHUB_OUTPUT
119
+
120
+ - name: Create GitHub Release
121
+ uses: softprops/action-gh-release@v2
122
+ with:
123
+ files: |
124
+ dist/*
125
+ dist/*.sigstore
126
+ body: ${{ steps.changelog.outputs.CHANGELOG }}
127
+ draft: false
128
+ prerelease: false
129
+ generate_release_notes: true
@@ -0,0 +1,141 @@
1
+ name: Test Publish to TestPyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ test_version:
7
+ description: 'Test version suffix (e.g., dev1, alpha1, rc1)'
8
+ required: false
9
+ default: 'dev1'
10
+ type: string
11
+ pull_request:
12
+ branches: [ main ]
13
+ paths:
14
+ - 'pyproject.toml'
15
+ - 'src/**'
16
+ - '.github/workflows/publish.yml'
17
+ - '.github/workflows/test-publish.yml'
18
+
19
+ jobs:
20
+ test-build:
21
+ name: Test build and publish to TestPyPI
22
+ runs-on: ubuntu-latest
23
+ environment:
24
+ name: testpypi
25
+ url: https://test.pypi.org/project/pltr/
26
+ permissions:
27
+ id-token: write # IMPORTANT: mandatory for trusted publishing
28
+
29
+ steps:
30
+ - name: Checkout code
31
+ uses: actions/checkout@v4
32
+
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v3
35
+ with:
36
+ version: "latest"
37
+ enable-cache: true
38
+
39
+ - name: Set up Python
40
+ uses: actions/setup-python@v5
41
+ with:
42
+ python-version: "3.11"
43
+
44
+ - name: Install dependencies
45
+ run: uv sync --dev
46
+
47
+ - name: Run tests
48
+ run: |
49
+ uv run pytest --cov=pltr --cov-report=xml --cov-report=term
50
+
51
+ - name: Run linting
52
+ run: |
53
+ uv run ruff check .
54
+ uv run ruff format --check .
55
+
56
+ - name: Run type checking
57
+ run: |
58
+ uv run mypy src/pltr
59
+
60
+ - name: Get current version
61
+ id: current_version
62
+ run: |
63
+ VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
64
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
65
+
66
+ - name: Install tomli-w for version updating
67
+ run: uv add tomli-w --dev
68
+
69
+ - name: Create test version
70
+ id: test_version
71
+ run: |
72
+ BASE_VERSION="${{ steps.current_version.outputs.VERSION }}"
73
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
74
+ TEST_SUFFIX="${{ github.event.inputs.test_version }}"
75
+ else
76
+ # For PR builds, use PR number and run number
77
+ TEST_SUFFIX="dev${{ github.run_number }}"
78
+ fi
79
+ TEST_VERSION="${BASE_VERSION}.${TEST_SUFFIX}"
80
+ echo "TEST_VERSION=$TEST_VERSION" >> $GITHUB_OUTPUT
81
+ echo "Building test version: $TEST_VERSION"
82
+
83
+ - name: Update version for test build
84
+ run: |
85
+ # Create a temporary pyproject.toml with test version
86
+ uv run python -c "
87
+ import tomllib, tomli_w
88
+
89
+ with open('pyproject.toml', 'rb') as f:
90
+ config = tomllib.load(f)
91
+
92
+ config['project']['version'] = '${{ steps.test_version.outputs.TEST_VERSION }}'
93
+
94
+ with open('pyproject.toml', 'wb') as f:
95
+ tomli_w.dump(config, f)
96
+ "
97
+
98
+ - name: Build package
99
+ run: |
100
+ uv build --no-sources
101
+
102
+ - name: Verify package contents
103
+ run: |
104
+ echo "Built distributions:"
105
+ ls -la dist/
106
+ echo ""
107
+ echo "Checking wheel contents:"
108
+ uv run python -m zipfile -l dist/*.whl
109
+
110
+ - name: Publish to TestPyPI
111
+ uses: pypa/gh-action-pypi-publish@release/v1
112
+ with:
113
+ repository-url: https://test.pypi.org/legacy/
114
+ print-hash: true
115
+ skip-existing: true
116
+
117
+ - name: Test installation from TestPyPI
118
+ run: |
119
+ # Wait a moment for TestPyPI to process the upload
120
+ sleep 30
121
+
122
+ # Try to install the package from TestPyPI
123
+ uv run pip install --index-url https://test.pypi.org/simple/ \
124
+ --extra-index-url https://pypi.org/simple/ \
125
+ pltr-cli==${{ steps.test_version.outputs.TEST_VERSION }}
126
+
127
+ # Test basic import and CLI functionality
128
+ uv run python -c "import pltr; print('Package import successful')"
129
+ uv run pltr --help
130
+
131
+ - name: Report test results
132
+ if: always()
133
+ run: |
134
+ echo "## Test Publish Results" >> $GITHUB_STEP_SUMMARY
135
+ echo "- **Test Version**: ${{ steps.test_version.outputs.TEST_VERSION }}" >> $GITHUB_STEP_SUMMARY
136
+ echo "- **TestPyPI URL**: https://test.pypi.org/project/pltr-cli/${{ steps.test_version.outputs.TEST_VERSION }}/" >> $GITHUB_STEP_SUMMARY
137
+ if [[ "${{ job.status }}" == "success" ]]; then
138
+ echo "- **Status**: ✅ Successfully published and tested" >> $GITHUB_STEP_SUMMARY
139
+ else
140
+ echo "- **Status**: ❌ Test failed" >> $GITHUB_STEP_SUMMARY
141
+ fi
@@ -0,0 +1,148 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ .pybuilder/
74
+ target/
75
+
76
+ # Jupyter Notebook
77
+ .ipynb_checkpoints
78
+
79
+ # IPython
80
+ profile_default/
81
+ ipython_config.py
82
+
83
+ # pyenv
84
+ .python-version
85
+
86
+ # pipenv
87
+ Pipfile.lock
88
+
89
+ # PEP 582
90
+ __pypackages__/
91
+
92
+ # Celery stuff
93
+ celerybeat-schedule
94
+ celerybeat.pid
95
+
96
+ # SageMath parsed files
97
+ *.sage.py
98
+
99
+ # Environments
100
+ .env
101
+ .venv
102
+ env/
103
+ venv/
104
+ ENV/
105
+ env.bak/
106
+ venv.bak/
107
+
108
+ # Spyder project settings
109
+ .spyderproject
110
+ .spyproject
111
+
112
+ # Rope project settings
113
+ .ropeproject
114
+
115
+ # mkdocs documentation
116
+ /site
117
+
118
+ # mypy
119
+ .mypy_cache/
120
+ .dmypy.json
121
+ dmypy.json
122
+
123
+ # Pyre type checker
124
+ .pyre/
125
+
126
+ # pytype static type analyzer
127
+ .pytype/
128
+
129
+ # Cython debug symbols
130
+ cython_debug/
131
+
132
+ # IDEs
133
+ .idea/
134
+ .vscode/
135
+ *.swp
136
+ *.swo
137
+ *~
138
+ .DS_Store
139
+
140
+ # Project specific
141
+ *.db
142
+ *.sqlite
143
+ *.pickle
144
+ config.ini
145
+ credentials.json
146
+
147
+ # ruff
148
+ .ruff_cache/
@@ -0,0 +1,15 @@
1
+ ## Dependency Management
2
+
3
+ Use uv for dependency management
4
+
5
+
6
+ ## Development tips
7
+
8
+ Always keep @DEVELOPMENT_PLAN.md up to date
9
+
10
+ ## General Guidance
11
+
12
+ 1. Be honest about what the SDK supports
13
+ 2. Remove non-working commands rather than showing confusing errors
14
+ 3. Focus on excellence in the features that do work
15
+ 4. Provide clear guidance about the RID-based nature of the API