Skip to main content

Installation and updates

Create a virtual environment

python -m venv .venv
source .venv/bin/activate

Fish shell:

python -m venv .venv
source .venv/bin/activate.fish

Install from the SDK repository

python -m pip install \
"git+https://github.com/Analog-Code-Monitor/Analog-WakaTime-Python-SDK.git"

Force an update

Use a forced reinstall after the SDK repository has been regenerated from a newer OpenAPI document:

python -m pip install \
--upgrade \
--force-reinstall \
--no-cache-dir \
"git+https://github.com/Analog-Code-Monitor/Analog-WakaTime-Python-SDK.git"

--force-reinstall matters when generated code changes without a package-version increase.

Production configuration

The production server is embedded in the generated package, so only authentication is required:

import Analog_WakaTime_SDK
import os

configuration = Analog_WakaTime_SDK.Configuration(
access_token=os.environ["ANALOG_WAKATIME_API_TOKEN"],
)

Self-hosted gateway

Override host only for self-hosted or local deployments:

import Analog_WakaTime_SDK
import os

configuration = Analog_WakaTime_SDK.Configuration(
host="https://waka.example.com",
access_token=os.environ["ANALOG_WAKATIME_API_TOKEN"],
)

Do not disable TLS verification in production.

Next step

Continue with authentication and client lifecycle.