Skip to main content

Ezeas Client API SDK (Python, async)

Project description

ezeas Client SDK (Python)

Minimal async client for the ezeas Client API using HS256 JWT.

This SDK is intended for backend integrations (Python 3.9+).
It handles:

  • Generating and caching short-lived JWT access tokens
  • Sending authenticated requests to the ezeas Client API
  • Simple error handling for business errors (4xx) and internal errors (5xx)

Learn more:
https://www.ezeas.com/sdk/python


Installation

pip install ezeas-client

Requires Python 3.9+.


Quick start

import asyncio
from ezeas_client import EzeasClient

async def main() -> None:
    client = EzeasClient(
        client_id="your-client-id",
        client_secret="your-client-secret",
        domain_key="domain-key",
        environment="live",       # or: "sandbox"
    )

    async with client:
        # Create / upsert contact
        contact_result = await client.contact.create({
            "external_id": "EXT-123",
            "employee_number": "EMP-001",
            "first_name": "Jane",
            "last_name": "Doe",
            "mobile": "+61400000000",
            "email": "jane.doe@example.com",
            "tenure_date": "2025-11-01",
            "role": "Talent", # Optional default to `Candidate`
        })
        print("Contact:", contact_result)

        # Submit timesheet
        timesheet_result = await client.timesheet.create({
            "job_code": "JOB-001",
            "timesheet_entries": [
                {
                    "date": "2025-11-01",
                    "hours_ordinary": 8.0,
                    "hours_time_and_half": 2.0,
                    "hours_double_time": 0.0,
                },
                {
                    "date": "2025-11-02",
                    "hours_ordinary": 7.5,
                    "hours_time_and_half": 0.0,
                    "hours_double_time": 0.0,
                },
            ],
        })
        print("Timesheet:", timesheet_result)

if __name__ == "__main__":
    asyncio.run(main())

Types (logical shapes)

from typing import List, Optional, TypedDict, Literal

DateString = str  # ISO date string "YYYY-MM-DD"

Role = Literal["Talent", "Candidate"]

class ContactInput(TypedDict, total=False):
    external_id: str
    employee_number: Optional[str]
    first_name: Optional[str]
    last_name: str
    mobile: Optional[str]
    email: str
    tenure_date: Optional[DateString]
    role: Optional[Role]

class TimesheetEntry(TypedDict):
    date: DateString
    hours_ordinary: float
    hours_time_and_half: float
    hours_double_time: float

class TimesheetInput(TypedDict):
    job_code: str
    timesheet_entries: List[TimesheetEntry]

Error handling

  • 2xx → parsed JSON returned
  • 4xx → raises Exception with backend payload
  • 5xx → raises Exception("Internal server error <status>: <body>")

Wrap calls in your own try/except as needed.


Token format (HS256 JWT)

Payload includes:

  • sub: client_id
  • client_id: client_id
  • iat: issued-at
  • exp: expiry (+900 seconds)

Signed using client_secret.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezeas_client-0.1.11.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezeas_client-0.1.11-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ezeas_client-0.1.11.tar.gz.

File metadata

  • Download URL: ezeas_client-0.1.11.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for ezeas_client-0.1.11.tar.gz
Algorithm Hash digest
SHA256 4b42e5ca8b982022658fd3f8928322815d741a810228d706fad4be1a4be2f577
MD5 91fbe1285d868ab69b62d7fd1ea81cc0
BLAKE2b-256 45ba67af5a6442b168ade650f3b5fdea57d5d1de41c30180fbf3223493c2b2d4

See more details on using hashes here.

File details

Details for the file ezeas_client-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: ezeas_client-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for ezeas_client-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 765673cbe1a1953f20d86802e22a3a6ea63bda1271cab992e4efc193ecadc4ce
MD5 06ba2d0cb07b7e47b197244509d6e9a7
BLAKE2b-256 2a34960a91adc34f5ecd6353deaa8d741f311282a9ee7ee6b568e24a29e4b79f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page