Skip to main content

An async Python client for the decidalo V3 Import API

Project description

decidalo_client.py

License: MIT Python Versions (officially) supported Pypi status badge

Unittests status badge Coverage status badge Linting status badge Formatting status badge

This repository contains two async Python clients for decidalo:

Client API Purpose
DecidaloClient (Import Client) V3 Import API Bulk-importing data (users, teams, projects, bookings, ...) into decidalo
DecidaloAppClient (App Client) App API (api.decidalo.app) Reading data from decidalo: searching people, viewing profiles, skills, certificates, projects

Use the Import Client when you need to push data into decidalo (e.g. syncing users from an HR system). Use the App Client when you need to read data from decidalo (e.g. finding people with specific skills).

[!IMPORTANT] This is a community project and is NOT an official decidalo client. It is not affiliated with or endorsed by Data Assessment Solutions GmbH.

Installation

pip install decidalo-client

Import Client (DecidaloClient)

The Import Client wraps the decidalo V3 Import API (Swagger UI). It is used for bulk-importing data into decidalo using an API key.

import asyncio
from decidalo_client import DecidaloClient, DecidaloAPIError, DecidaloAuthenticationError

async def main() -> None:
    async with DecidaloClient(api_key="your-api-key") as client:
        # Get all users
        users = await client.get_users()
        for user in users:
            print(f"{user.displayName} ({user.email})")

        # Get all projects
        projects = await client.get_all_projects()
        for project in projects:
            print(f"{project.properties.name.value}")

if __name__ == "__main__":
    asyncio.run(main())

Error Handling

import asyncio
from decidalo_client import DecidaloClient, DecidaloAPIError, DecidaloAuthenticationError

async def main() -> None:
    async with DecidaloClient(api_key="your-api-key") as client:
        try:
            users = await client.get_users()
        except DecidaloAuthenticationError as e:
            print(f"Authentication failed: {e.message}")
        except DecidaloAPIError as e:
            print(f"API error {e.status_code}: {e.message}")

if __name__ == "__main__":
    asyncio.run(main())

Import Client Features

  • Async HTTP client built on aiohttp
  • Type-safe request/response models using pydantic
  • All major API endpoints:
    • Users - Get users, import users (sync/async), check import status
    • Teams - Get teams, import teams (sync/async), check import status
    • Companies - Get companies, import companies
    • Projects - Get projects, get all projects, import projects, check existence
    • Bookings - Get bookings, get bookings by project, import bookings
    • Absences - Get absences, import absences
    • Resource Requests - Get resource requests, import resource requests
    • Roles - Import roles
    • Working Time Patterns - Get working time patterns, import working time patterns

App Client (DecidaloAppClient)

The App Client wraps the decidalo App API (api.decidalo.app). It is used for reading data from decidalo — searching for people, viewing profiles, exploring skills, certificates, and projects.

[!NOTE] The App API does not have a public Swagger UI. The client was reverse-engineered from the decidalo web application.

Authentication

The App Client authenticates via OAuth2 (Microsoft SSO) through login.decidalo.app. There are two authentication flows:

  1. Device Code Flow (interactive, for first-time setup) — prints a URL and code to the console for you to open in a browser.
  2. Refresh Token Flow (headless, for automation) — reuses a previously obtained refresh token.
import asyncio
from decidalo_app_client import DecidaloAppClient
from decidalo_app_client.auth import DecidaloAuth

async def first_time_login() -> None:
    """Interactive login — run this once to obtain a refresh token."""
    token = await DecidaloAuth.device_code_login()
    # The device code flow prints a URL and code to the console.
    # Open the URL in your browser and enter the code to authenticate.
    print(f"Save this refresh token for future use: {token.refresh_token}")

asyncio.run(first_time_login())

Store the refresh token securely (e.g. in an environment variable or a secrets manager). For subsequent runs, use the refresh token:

token = await DecidaloAuth.refresh("your-saved-refresh-token")

Minimal Working Example

import asyncio
from decidalo_app_client import DecidaloAppClient
from decidalo_app_client.auth import DecidaloAuth

async def main() -> None:
    # Use a refresh token obtained from a previous device_code_login()
    token = await DecidaloAuth.refresh("your-saved-refresh-token")

    async with DecidaloAppClient(token=token) as client:
        # Search for people with specific skills
        results = await client.search.find_people(keywords=["SAP", "Python"])
        for user in results.usersWithMatchedQualities:
            print(f"User {user.userId} (Score: {user.score})")

        # Get a user's profile header
        header = await client.profile.get_header(user_id=42)
        print(f"Profile quality: {header.profileQuality}, last edited by: {header.lastEditor}")

        # Browse available skill categories
        categories = await client.skills.get_categories()
        for cat in categories:
            print(f"Category: {cat.categoryName}")

asyncio.run(main())

You can also pass a static Bearer token string directly if you manage tokens yourself:

async with DecidaloAppClient(token="your-bearer-token") as client:
    ...

App Client Features

  • Async HTTP client built on aiohttp with automatic token refresh
  • OAuth2 Device Code Flow and Refresh Token Flow (direct OIDC HTTP, no extra dependency)
  • Type-safe Pydantic models for most responses
  • Domain-based API structure:
    • Search — Find people by skills/keywords, autocomplete user names, get filter fields
    • Profile — Read profile headers, skills, certificates, languages, industries, roles, competencies, projects
    • Projects — Get project headers, overviews, details, team members, references
    • Skills — Autocomplete skills, get levels, categories, skill grids, assessments
    • Certificates — Autocomplete certificates, get holders, certificate grids
    • Roles — Get roles, check user skills/certificates against role requirements
    • Teams — Get team details, find teams by manager, get members under current user

Development

Clone the repository and install the development environment:

git clone https://github.com/Hochfrequenz/decidalo_client.py.git
cd decidalo_client.py
tox -e dev

To regenerate the Pydantic models from the OpenAPI spec:

tox -e codegen

For detailed information on the development setup (tox configuration, IDE setup, etc.), see the Hochfrequenz Python Template Repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

decidalo_client-0.2.0.tar.gz (103.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decidalo_client-0.2.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file decidalo_client-0.2.0.tar.gz.

File metadata

  • Download URL: decidalo_client-0.2.0.tar.gz
  • Upload date:
  • Size: 103.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for decidalo_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 95bd570b090ed80399cbec6408e8cd78d1ef11bbb20a61f6828c80567a57bf1a
MD5 10131512a4e077779faaa5c57841459b
BLAKE2b-256 56619569030655c4880f292dccf38cbc929fc5173992f48934315eed9c647566

See more details on using hashes here.

Provenance

The following attestation bundles were made for decidalo_client-0.2.0.tar.gz:

Publisher: python-publish.yml on Hochfrequenz/decidalo_client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decidalo_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for decidalo_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c98e339ae7ad6b786ca7e3e85b947a8b2381dadacb8b75dbb1c13871bf32868
MD5 a17216d3952fa6dbde963bc7e49ceae6
BLAKE2b-256 f50505082709ecde824030b539f46fa065a8355cecdd39a13713686647f14eac

See more details on using hashes here.

Provenance

The following attestation bundles were made for decidalo_client-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on Hochfrequenz/decidalo_client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page