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:

ClassImportResource accessBest for
SanerClientfrom saner import SanerClientNested: client.platform.Organization, client.cvem.PatchIntegrations that need both products, or when you're not yet sure
PlatformClientfrom saner.platform import PlatformClientFlat: client.OrganizationIntegrations scoped entirely to platform administration
CvemClientfrom saner.cvem import CvemClientFlat: client.PatchIntegrations 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:

  1. Initialize the client
  2. Call an API resource method
  3. 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.


Did this page help you?