Metadata-Version: 2.4
Name: timr_api
Version: 2.0.0
Summary: timr API
Author-email: troii Software GmbH <info@timr.com>
License: Apache 2.0
Project-URL: Homepage, https://developer.timr.com
Project-URL: Repository, https://github.com/troii/timr-api
Keywords: OpenAPI,OpenAPI-Generator,timr API
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3<3.0.0,>=2.8.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2.11
Requires-Dist: typing-extensions>=4.7.1
Dynamic: license-file

# timr-api

Official Python client for the [timr](https://www.timr.com) API.

The timr API exposes the recordings a user makes — working times, project times and drive
logs — together with the master data they refer to: users, teams, tasks, cars, working time
types, work schedule models and holiday calendars.

**Full API reference: [developer.timr.com](https://developer.timr.com)**

## Requirements

Python 3.11+

## Installation

```sh
pip install timr-api
```

## Usage

```python
import os
import timr_api

configuration = timr_api.Configuration()
configuration.access_token = os.environ["TIMR_ACCESS_TOKEN"]

with timr_api.ApiClient(configuration) as api_client:
    cars = timr_api.CarApi(api_client).fetch_cars()
    for car in cars.data:
        print(f"{car.name} ({car.plate})")
```

`Configuration` defaults to `https://api.timr.com/v1`; pass `host=` to point at another
environment. See `timr_api/configuration.py` for the full set of parameters.

## Authentication

The API uses OAuth 2.0. Two flows are supported:

| Flow | Use for | Scopes |
| --- | --- | --- |
| `client_credentials` | server-to-server integrations acting as the client | `openid`, `timrclient` |
| `authorization_code` (with PKCE) | acting on behalf of a timr user | `openid`, `offline_access` |

Authorization endpoint: `https://system.timr.com/id/oauth2/authorize`

Obtain a token through your OAuth library of choice and assign it to
`configuration.access_token`.

## Support

[info@timr.com](mailto:info@timr.com)

## License

Apache License 2.0
