Skip to content

Repository files navigation

kimai-python

JSON API for the Kimai 2 time-tracking software. Read more about its usage in the API documentation and then download a Swagger file for import e.g. in Postman. Be aware: it is not yet considered stable and BC breaks might happen.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 0.5
  • Package version: 0.1.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/kbancerz/kimai-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/kbancerz/kimai-python.git)

Then import the package:

importkimai_python

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importkimai_python

Getting Started

Please follow the installation procedure and then run the following:

from __future__ importprint_functionimporttimeimportkimai_pythonfromkimai_python.restimportApiExceptionfrompprintimportpprint# Configure API key authorization: apiTokenconfiguration=kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] ='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'# Configure API key authorization: apiUserconfiguration=kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] ='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'# create an instance of the API classapi_instance=kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
project='project_example'# str | Project ID to filter activities (optional)projects='projects_example'# str | Comma separated list of project IDs to filter activities (optional)visible='visible_example'# str | Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1) (optional)globals='globals_example'# str | Use if you want to fetch only global activities. Allowed values: true (default: false) (optional)globals_first='globals_first_example'# str | Deprecated parameter, value is not used any more (optional)order_by='order_by_example'# str | The field by which results will be ordered. Allowed values: id, name, project (default: name) (optional)order='order_example'# str | The result order. Allowed values: ASC, DESC (default: ASC) (optional)term='term_example'# str | Free search term (optional)try:
# Returns a collection of activitiesapi_response=api_instance.api_activities_get(project=project, projects=projects, visible=visible, globals=globals, globals_first=globals_first, order_by=order_by, order=order, term=term)
pprint(api_response)
exceptApiExceptionase:
print("Exception when calling ActivityApi->api_activities_get: %s\n"%e)

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
ActivityApiapi_activities_getGET /api/activitiesReturns a collection of activities
ActivityApiapi_activities_id_getGET /api/activities/{id}Returns one activity
ActivityApiapi_activities_id_meta_patchPATCH /api/activities/{id}/metaSets the value of a meta-field for an existing activity
ActivityApiapi_activities_id_patchPATCH /api/activities/{id}Update an existing activity
ActivityApiapi_activities_id_rates_getGET /api/activities/{id}/ratesReturns a collection of all rates for one activity
ActivityApiapi_activities_id_rates_postPOST /api/activities/{id}/ratesAdds a new rate to an activity
ActivityApiapi_activities_id_rates_rate_id_deleteDELETE /api/activities/{id}/rates/{rateId}Deletes one rate for an activity
ActivityApiapi_activities_postPOST /api/activitiesCreates a new activity
CustomerApiapi_customers_getGET /api/customersReturns a collection of customers
CustomerApiapi_customers_id_getGET /api/customers/{id}Returns one customer
CustomerApiapi_customers_id_meta_patchPATCH /api/customers/{id}/metaSets the value of a meta-field for an existing customer
CustomerApiapi_customers_id_patchPATCH /api/customers/{id}Update an existing customer
CustomerApiapi_customers_id_rates_getGET /api/customers/{id}/ratesReturns a collection of all rates for one customer
CustomerApiapi_customers_id_rates_postPOST /api/customers/{id}/ratesAdds a new rate to a customer
CustomerApiapi_customers_id_rates_rate_id_deleteDELETE /api/customers/{id}/rates/{rateId}Deletes one rate for an customer
CustomerApiapi_customers_postPOST /api/customersCreates a new customer
DefaultApiapi_config_i18n_getGET /api/config/i18nReturns the user specific locale configuration
DefaultApiapi_config_timesheet_getGET /api/config/timesheetReturns the instance specific timesheet configuration
DefaultApiapi_ping_getGET /api/pingA testing route for the API
DefaultApiapi_version_getGET /api/versionReturns information about the Kimai release
ProjectApiapi_projects_getGET /api/projectsReturns a collection of projects.
ProjectApiapi_projects_id_getGET /api/projects/{id}Returns one project
ProjectApiapi_projects_id_meta_patchPATCH /api/projects/{id}/metaSets the value of a meta-field for an existing project
ProjectApiapi_projects_id_patchPATCH /api/projects/{id}Update an existing project
ProjectApiapi_projects_id_rates_getGET /api/projects/{id}/ratesReturns a collection of all rates for one project
ProjectApiapi_projects_id_rates_postPOST /api/projects/{id}/ratesAdds a new rate to an project
ProjectApiapi_projects_id_rates_rate_id_deleteDELETE /api/projects/{id}/rates/{rateId}Deletes one rate for an project
ProjectApiapi_projects_postPOST /api/projectsCreates a new project
TagApiapi_tags_getGET /api/tagsFetch all existing tags
TagApiapi_tags_id_deleteDELETE /api/tags/{id}Delete a tag
TagApiapi_tags_postPOST /api/tagsCreates a new tag
TeamApiapi_teams_getGET /api/teamsFetch all existing teams
TeamApiapi_teams_id_customers_customer_id_deleteDELETE /api/teams/{id}/customers/{customerId}Revokes access for a customer from a team
TeamApiapi_teams_id_customers_customer_id_postPOST /api/teams/{id}/customers/{customerId}Grant the team access to a customer
TeamApiapi_teams_id_deleteDELETE /api/teams/{id}Delete a team
TeamApiapi_teams_id_getGET /api/teams/{id}Returns one team
TeamApiapi_teams_id_members_user_id_deleteDELETE /api/teams/{id}/members/{userId}Removes a member from the team
TeamApiapi_teams_id_members_user_id_postPOST /api/teams/{id}/members/{userId}Add a new member to a team
TeamApiapi_teams_id_patchPATCH /api/teams/{id}Update an existing team
TeamApiapi_teams_id_projects_project_id_deleteDELETE /api/teams/{id}/projects/{projectId}Revokes access for a project from a team
TeamApiapi_teams_id_projects_project_id_postPOST /api/teams/{id}/projects/{projectId}Grant the team access to a project
TeamApiapi_teams_postPOST /api/teamsCreates a new team
TimesheetApiapi_timesheets_active_getGET /api/timesheets/activeReturns the collection of active timesheet records
TimesheetApiapi_timesheets_getGET /api/timesheetsReturns a collection of timesheet records
TimesheetApiapi_timesheets_id_deleteDELETE /api/timesheets/{id}Delete an existing timesheet record
TimesheetApiapi_timesheets_id_duplicate_patchPATCH /api/timesheets/{id}/duplicateDuplicates an existing timesheet record
TimesheetApiapi_timesheets_id_export_patchPATCH /api/timesheets/{id}/exportSwitch the export state of a timesheet record to (un-)lock it
TimesheetApiapi_timesheets_id_getGET /api/timesheets/{id}Returns one timesheet record
TimesheetApiapi_timesheets_id_meta_patchPATCH /api/timesheets/{id}/metaSets the value of a meta-field for an existing timesheet.
TimesheetApiapi_timesheets_id_patchPATCH /api/timesheets/{id}Update an existing timesheet record
TimesheetApiapi_timesheets_id_restart_patchPATCH /api/timesheets/{id}/restartRestarts a previously stopped timesheet record for the current user
TimesheetApiapi_timesheets_id_stop_patchPATCH /api/timesheets/{id}/stopStops an active timesheet record
TimesheetApiapi_timesheets_postPOST /api/timesheetsCreates a new timesheet record
TimesheetApiapi_timesheets_recent_getGET /api/timesheets/recentReturns the collection of recent user activities
UserApiapi_users_getGET /api/usersReturns the collection of all registered users
UserApiapi_users_id_getGET /api/users/{id}Return one user entity
UserApiapi_users_id_patchPATCH /api/users/{id}Update an existing user
UserApiapi_users_me_getGET /api/users/meReturn the current user entity
UserApiapi_users_postPOST /api/usersCreates a new user

Documentation For Models

Documentation For Authorization

apiToken

  • Type: API key
  • API key parameter name: X-AUTH-TOKEN
  • Location: HTTP header

apiUser

  • Type: API key
  • API key parameter name: X-AUTH-USER
  • Location: HTTP header

Author

About

Kimai REST Client for Python

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages