api_interface
main.Kimai.api_interface
¤
Kimai API Interface Module.
Classes¤
KimaiAPI(api_key, base_url)
¤
A class to interact with the Clockify API for project management.
Initialize the KimaiAPI instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str
|
Your personal Kimai API key. |
required |
base_url
|
str
|
The base url of Kimai API. |
required |
Source code in main/Kimai/api_interface.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
Methods:¤
get_time_entries(start_date, end_date, project_id)
¤
Retrieve detailed time entries for a specified workspace using the API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_date
|
datetime
|
First day of the time entries to be retrieved. |
required |
end_date
|
datetime
|
Last day of the time entries to be retrieved. |
required |
project_id
|
int
|
Kimai id of the project to retrieve time entries for. |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of dictionaries containing the entry id, project id, user email and |
list[dict[str, Any]]
|
begin and end date time for the entry. |
Raises:
| Type | Description |
|---|---|
HTTPError
|
If the API request fails. |
Source code in main/Kimai/api_interface.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |