Overview
The Saner Python SDK provides a production-ready interface for integrating with the Saner Platform APIs quickly and reliably. It abstracts low-level HTTP handling and adds built-in validation, retry logic, logging support, and developer-friendly tooling to accelerate automation and integration workflows.
Instead of manually constructing API requests, developers can interact with Saner services using structured Python methods aligned directly with platform endpoints.
The SDK is designed for automation engineers, security teams, and developers building scalable integrations across Saner environments.
Why Use the Saner Python SDK?
The SDK simplifies API consumption and improves reliability by handling common integration challenges automatically.
Key advantages include:
- Strict parameter validation before API execution to prevent invalid server calls
- Built-in retry mechanism with exponential backoff for resilient communication
- Configurable request timeout support
- Multi-account support within a single script, via multiple client instances
- Product-scoped or universal client classes to match your integration's footprint
- Integrated logging for debugging and traceability, with credentials automatically redacted and log files locked to owner-only access
- Response size limits to guard automation against an unexpectedly large or malformed payload
- Rich IDE docstrings for inline usage guidance
- Seamless alignment with Saner API documentation
- Modern architecture following Python best practices
These features reduce integration complexity while improving developer productivity and operational stability.
Choosing a Client: SanerClient vs. PlatformClient vs. CvemClient
The SDK's 20 API resources are split into two products: platform (organizations, accounts, users) and cvem (vulnerability management, patching, compliance, endpoints). The SDK ships one client class per way you might want to reach them:
| Class | Import | Resource access | Best for |
|---|---|---|---|
SanerClient | from saner import SanerClient | Nested: client.platform.Organization, client.cvem.Patch | Integrations that need both products, or when you're not yet sure |
PlatformClient | from saner.platform import PlatformClient | Flat: client.Organization | Integrations scoped entirely to platform administration |
CvemClient | from saner.cvem import CvemClient | Flat: client.Patch | Integrations scoped entirely to vulnerability/patch/compliance work |
All three share identical authentication, retry, and logging behavior. The only real tradeoff is that each client instance opens its own pair of pooled HTTP sessions, so instantiating both PlatformClient and CvemClient together costs twice the connections of one SanerClient. For the full comparison, the complete resource-to-product mapping, and the connection-pooling details, see the Client Types guide.
Supported Environment
The Saner Python SDK supports:
- Python 3.9 and above
- Linux, macOS, and Windows environments
- Virtual environments (recommended for dependency isolation)
Typical Use Cases
Common scenarios where the SDK improves efficiency include:
- Automating vulnerability and posture workflows
- Managing organizations, users, and assets programmatically
- Integrating Saner into CI/CD security pipelines
- Building multi-account orchestration scripts
- Creating security monitoring and reporting automation
Example Workflow
A typical SDK interaction follows three simple steps:
- Initialize the client
- Call an API resource method
- Process the response
Example:
from saner import SanerClient
client = SanerClient(
api_key="YOUR_API_KEY",
accountid="YOUR_ACCOUNT_ID",
base_url="https://eu.saner.secpod.com"
)
response = client.platform.Organization.get(organization="secpod")
print(response)Equivalent using a scoped client, if your integration only ever needs platform resources:
from saner.platform import PlatformClient
client = PlatformClient(
api_key="YOUR_API_KEY",
accountid="YOUR_ACCOUNT_ID",
base_url="https://eu.saner.secpod.com"
)
response = client.Organization.get(organization="secpod")
print(response)Each API resource in the SDK maps directly to its corresponding Saner platform endpoint, ensuring predictable and consistent usage across the documentation.
What This Guide Covers
This guide explains the common SDK usage patterns required to start integrating quickly, including:
- Installation
- Choosing between SanerClient, PlatformClient, and CvemClient
- Client configuration
- Logging setup
- Retry and timeout configuration
- Multi-account usage
- Error handling behavior
Detailed endpoint-level SDK examples are available alongside each API reference section in the platform documentation.
Updated about 9 hours ago
