Python Private API SDK

A Python client library for the CATAPA Private API with session-based authentication.

Features

  • πŸ” Session-Based Authentication - Automatic login and session management with cookie handling

  • πŸš€ Simple API - Clean interface for making authenticated requests to CATAPA Private API

  • πŸ”„ Automatic Session Management - Sessions are automatically maintained and refreshed

Installation

Using pip

pip install catapa-private

Quick Start

A complete Hello World example to get you started immediately.

from catapa_private import CatapaPrivate

def main() -> None:
    client = CatapaPrivate(
        tenant="zfrl",
        username="demo",
        password="dmo-password"
    )

    response = client.get("/core/countries", params={"page": 0, "size": 10})
    response.raise_for_status()
    data = response.json()
    print(f"Found {len(data.get('content', []))} countries")

if __name__ == "__main__":
    main()

πŸ’‘ Tip: By default, the SDK connects to https://api.catapa.com. To use a different base URL (e.g., for staging or testing), pass the base_url parameter:

Getting Your Credentials

To use the SDK with your own account, you'll need the following authentication credentials:

Tenant ID

Your tenant ID is your organization's unique identifier in CATAPA. To obtain it, please contact support@catapa.comenvelope.

Username and Password

Your username and password are your CATAPA account credentials used for session-based authentication.

⚠️ Important: Keep your credentials secure and never commit them to version control. Consider using environment variables or a secrets management system.

Private API Documentation

Explore our interactive Swagger documentation to understand the available endpoints, request schemas, and response models for each module.

Tutorials

More intermediate examples to help you learn the SDK.

Tutorial 1: Complete CRUD Operations

A complete example showing how to perform Create, Read, Update, and Delete operations.

Tutorial 2: Error Handling and Response Management

A complete example showing how to handle errors and manage responses properly.

Cookbook

Intermediate to Advanced examples for real-world scenarios.

Cookbook 1: Concurrent API Calls

A complete example for making concurrent API calls efficiently.

Requirements

  • Python 3.11+

Last updated