Skip to content

Resource WorkResource

CrucifiedPain edited this page Jun 26, 2026 · 8 revisions

WorkResource (client.work)

Endpoints: • work.getStatsByUserId • work.getStatsByCompany • work.getStatsByWorkerAndCompany

.get_stats_by_company()

Get daily work statistics for a specific company.

Args: company_id: The company to query. days: Number of past days to include (default 30). timezone: IANA timezone string for grouping daily buckets.

Returns: A list of :class:~warera.models.WorkStats items, one per day.

Signature

await client.work.get_stats_by_company(company_id: 'str', *, days: 'int' = 30, timezone: 'str' = 'UTC') -> 'list[WorkStats]'

Parameters

Name Type Default
company_id str *Required*
days int 30
timezone str UTC

Return Models

WorkStats

Daily work statistics for a user, company, or worker+company combination.

Field Type Required Description
dailyDate string \| null
total number \| null
wage number \| null
employeeProd number \| null
selfWork number \| null
automatedEngine number \| null

.get_stats_by_user()

Get daily work statistics for all companies owned by a user.

Args: user_id: The user whose work stats to retrieve. days: Number of past days to include (default 30). timezone: IANA timezone string for grouping daily buckets (e.g. "Europe/Paris").

Returns: A list of :class:~warera.models.WorkStats items, one per day.

Signature

await client.work.get_stats_by_user(user_id: 'str', *, days: 'int' = 30, timezone: 'str' = 'UTC') -> 'list[WorkStats]'

Parameters

Name Type Default
user_id str *Required*
days int 30
timezone str UTC

Return Models

WorkStats

Daily work statistics for a user, company, or worker+company combination.

Field Type Required Description
dailyDate string \| null
total number \| null
wage number \| null
employeeProd number \| null
selfWork number \| null
automatedEngine number \| null

.get_stats_by_worker_and_company()

Get daily work statistics for a specific worker at a specific company.

Args: worker_id: The worker (user) ID. company_id: The company ID. days: Number of past days to include (default 30). timezone: IANA timezone string for grouping daily buckets.

Returns: A list of :class:~warera.models.WorkStats items, one per day.

Signature

await client.work.get_stats_by_worker_and_company(worker_id: 'str', company_id: 'str', *, days: 'int' = 30, timezone: 'str' = 'UTC') -> 'list[WorkStats]'

Parameters

Name Type Default
worker_id str *Required*
company_id str *Required*
days int 30
timezone str UTC

Return Models

WorkStats

Daily work statistics for a user, company, or worker+company combination.

Field Type Required Description
dailyDate string \| null
total number \| null
wage number \| null
employeeProd number \| null
selfWork number \| null
automatedEngine number \| null

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.work.invalidate_cache() -> 'None'

Clone this wiki locally