Prerequisites
Before installing the SDK, ensure you have:- Python 3.8+ installed on your system
- pip package manager
- Kubiya API Key from the Kubiya platform
Installation
Install via pip
The simplest way to install the SDK is via pip:Install from Source
For the latest development version:Install with 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
Option 1: Environment Variables (Recommended)
Set your API key as an environment variable:~/.bashrc, ~/.zshrc, etc.):
~/.kubiya/config.yaml:
Option 3: Programmatic Configuration
Configure directly in your Python code:Verify Installation
Quick Test
Test your installation and connection:Version Check
Check your installed SDK version:Feature Test
Test DSL functionality: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:
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 correctConnectionTimeout: 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+ |