Prerequisites
Before installing the SDK, ensure you have:- Python 3.8+ installed on your system
- pip package manager
- Kubiya Control Plane API Key from the Kubiya platform
Installation
Install via pip
Install from Source
Optional Dependencies
Configuration
Get Your API Key
- Log in to the Kubiya platform
- Navigate to Settings → API Keys
- Create a new API key or copy an existing one
Configure Authentication
Configure the client directly in your Python code with your API key:api_key parameter is required. The base_url parameter is optional and defaults to the Kubiya cloud platform. Specify a custom base_url for on-premise deployments.
Verify Installation
Quick Test
Test your installation and connection:Version Check
Feature Test
IDE Setup
VS Code
- Install the Python extension
- Add these settings to your workspace (
.vscode/settings.json):
- For better autocompletion, install type stubs:
PyCharm
- Go to File → Settings → Project → Python Interpreter
- Add the
kubiya-sdkpackage to your interpreter - Enable type checking in Settings → Editor → Inspections → Python
- Configure code style to use Black formatter
Jupyter Notebooks
The SDK works great in Jupyter notebooks:Docker Setup
Using Docker
Create aDockerfile:
Docker Compose
Create adocker-compose.yml:
Environment Variables
Configure your environment by creating a.env file:
Development Setup
For SDK development and contributions:Clone Repository
Create Virtual Environment
Install Development Dependencies
Run Tests
Troubleshooting
Common Issues
ImportError: No module named ‘kubiya’
Solution: Ensure the SDK is installed in your current Python environmentAuthenticationError: Invalid API key
Solution: Verify your API key is correct and passed to the ControlPlaneClient constructorConnectionTimeout: Request timed out
Solution: Increase timeout or check network connectivitySSL Certificate Error
Solution: For development environments only (not recommended for production)Enable Debug Logging
For troubleshooting, enable debug logging:Version Compatibility
| Kubiya SDK | Python | Kubiya Platform |
|---|---|---|
| 1.0.x | 3.8+ | v2.0+ |
| 0.9.x | 3.7+ | v1.5+ |