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
Exceptionwith 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_idclient_id: client_idiat: issued-atexp: 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezeas_client-0.1.9.tar.gz.
File metadata
- Download URL: ezeas_client-0.1.9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ede3933cbf568c70e11b0a6a360fda64a3916474dceb5d94f4091fa7520e32d9
|
|
| MD5 |
934e959700a205940c0500ccb161bf68
|
|
| BLAKE2b-256 |
783b82323386729371e2082d0d0d937dce51f06c4b783dd016a8c070f5272a8a
|
File details
Details for the file ezeas_client-0.1.9-py3-none-any.whl.
File metadata
- Download URL: ezeas_client-0.1.9-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35252b43451756aba9f7e74297fc487a0163d027114788295bc9bb378ecf2cd9
|
|
| MD5 |
f82ee005500acc61025d601771c210a9
|
|
| BLAKE2b-256 |
27eb2136e6a97bc89eab33b6ce0dd2fa191103f40eb16158dbe8fbdebc5d22b6
|