Skip to content

Getting Started

Christian KASSE edited this page Apr 2, 2026 · 2 revisions

Getting Started

Installation

# pip
pip install essabu

# poetry
poetry add essabu

# pipenv
pipenv install essabu

Authentication

The SDK requires an API key and a tenant ID. You can provide them explicitly or via environment variables.

Explicit configuration

from essabu import Essabu

client = Essabu(
    api_key="esa_live_your_api_key",
    tenant_id="your-tenant-id",
)

Environment variables

export ESSABU_API_KEY=esa_live_your_api_key
export ESSABU_TENANT_ID=your-tenant-id
from essabu import Essabu

client = Essabu()  # reads from environment automatically

Configuration Options

Parameter Env Variable Default Description
api_key ESSABU_API_KEY -- Your API key (required)
tenant_id ESSABU_TENANT_ID -- Your tenant ID (required)
base_url ESSABU_BASE_URL https://api.essabu.com API base URL
timeout ESSABU_TIMEOUT 30.0 Request timeout (seconds)
max_retries ESSABU_MAX_RETRIES 3 Max retry attempts

Basic Usage

from essabu import Essabu

client = Essabu(api_key="esa_live_xxx", tenant_id="tenant-id")

# Create a resource
employee = client.hr.employees.create(
    first_name="Jean",
    last_name="Mukendi",
    email="jean@example.com",
)

# List with pagination
page = client.hr.employees.list(page=1, page_size=25)
print(f"Total: {page.total}")

# Retrieve by ID
emp = client.hr.employees.retrieve("employee-uuid")

# Update
client.hr.employees.update("employee-uuid", position_id="new-position")

# Delete
client.hr.employees.delete("employee-uuid")

# Always close when done
client.close()

Context Manager

The client supports the context manager protocol for automatic cleanup:

with Essabu(api_key="esa_live_xxx", tenant_id="tenant-id") as client:
    employees = client.hr.employees.list()
    # client is automatically closed when the block exits

Available Modules

Module Accessor Description
HR client.hr Employees, contracts, leaves, payroll
Accounting client.accounting Accounts, invoices, payments, wallets
Identity client.identity Auth, users, roles, tenants
Trade client.trade CRM, customers, opportunities, orders
Payment client.payment Payment intents, loans, subscriptions
E-Invoice client.einvoice Electronic invoicing, compliance
Project client.project Projects, tasks, milestones
Asset client.asset Fixed assets, vehicles, depreciation

All modules are lazy-loaded -- they are only initialized when you first access them.

Next Steps

Clone this wiki locally