Python SDK: Getting Started

The official Python distribution is keito. These guides describe source release 0.3.0, which includes corrected production defaults, timer helpers and expense receipt methods. Its PyPI publication is pending; the latest PyPI package, 0.2.0, does not provide this complete interface. Install the verified source commit below rather than assume a registry upgrade is available.

Install

python -m pip install 'keito @ https://github.com/osodevops/keito-python/archive/6da48aea9602e29e7a63dd85c588e05a508a25e2.tar.gz'

This public archive is pinned to the exact 0.3.0 release commit. It builds and installs the package locally; it does not claim that PyPI hosts 0.3.0. Check the installed distribution with python -m pip show keito. Python 3.9 or later is supported. Create a key with All permitted operations and copy the Company ID under Settings → API & Developers.

Initialize

import os
from keito import Keito

with Keito(
    api_key=os.environ["KEITO_API_KEY"],
    account_id=os.environ["KEITO_ACCOUNT_ID"],
) as client:
    for project in client.projects.list():
        print(project.id, project.name)

Keito() also reads KEITO_API_KEY and KEITO_ACCOUNT_ID when arguments are omitted. Keep keys in a local/server environment. A full-access key inherits the bound person’s current permissions; it does not grant Administrator access.

Configuration

Option Default Meaning
api_key KEITO_API_KEY API key
account_id KEITO_ACCOUNT_ID Company ID
base_url https://app.keito-test.com API origin; resource methods add /api/v2
max_retries 2 Maximum retries for replay-safe requests
timeout 60.0 Request timeout in seconds

Use the origin for a custom environment. A trailing /api/v2 is normalized, so it is not added twice. Earlier packages defaulted to .io; upgrade rather than rely on that host.

Pagination

List methods return lazy iterators, not a response with .data. Iterate directly with for; for the async client, use async for without awaiting the list call. See Async usage.

Next steps