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.10.tar.gz (4.3 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.10-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezeas_client-0.1.10.tar.gz
  • Upload date:
  • Size: 4.3 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.10.tar.gz
Algorithm Hash digest
SHA256 4c9cca00076f76ce9cca2544ddd78ff10e99106297d81bfc1689c54acccf4441
MD5 03efc2f617ec5985e8496b2588d12d6a
BLAKE2b-256 6eb621e9e50769a62640384ffbf6008a93b5bd18c4934278a5a0995b8c8ea6bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezeas_client-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0fc993ca1e061e3a50ca0e4182ac844b390ca8d00026ed3dafa312af60d755
MD5 356cb729c4efd535957b95b61ff761f1
BLAKE2b-256 00a04519d015cc8a082051e0b93adaf5c5f0aa00e3d5b64a7e38235c0293f5fb

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