Skip to main content

Autofill missing King of Time (KOT) time records using Selenium

Project description

kot-attendance-bot

Selenium helper for automating King of Time attendance tasks.

Installation

pip install kot-attendance-bot

Setup

On first run, the tool prompts for clock-in, break-start times, and browser selection, then asks whether to save them to config.toml.

Edit config.toml if you want different default times, auto-login, or proxy settings. HTTP_PROXY and HTTPS_PROXY environment variables override values in config.toml.

Credentials

Login is manual unless configured via config.toml or environment variables:

  • Environment Variables: Set KOT_USERNAME and KOT_PASSWORD. This automatically enables auto-login.
  • Config File: Set auto_login = true and provide username and password.

Note: Auto-login stores the password in plaintext in config.toml. Using environment variables is recommended for better security.

Commands

Fill Missing Records

kot-attendance-bot fill [options]

Opens King of Time, prompts for login (if needed), switches to the requested month, and fills missing time records for weekdays.

  • Default visibility: Visible (use --headless to run hidden).
  • Default month: Current month (checks previous month first during the first work week).

Holiday Lookup

kot-attendance-bot holiday [options]

Extracts holidays (system holidays and scheduled leaves) for a specific month.

  • Default visibility: Headless (use --visible to see the browser).
  • Caching: Results are saved in kot-attendance-bot.json to avoid redundant browser sessions.
  • Formats: ASCII calendar (default), lines of text (--text), or JSONL (--json).

AI Agent Integration

This project is "Agent-Ready," featuring the King of Time Attendance skill—a set of procedural instructions that allow AI agents to handle your attendance tasks autonomously. Whether you use Gemini CLI, Claude Code, GitHub Copilot, or Codex, you can simply ask the agent to "fill my missing records" or "check my April holidays," and it will know exactly how to execute the commands with the correct flags and environment variables.

To use the skill:

  • Gemini CLI: Install the packaged skill from SkillHub or directly from source:
    gemini skills install https://git.sr.ht/~ivan-ustinov/king-of-time-attendance.skill --scope workspace
    /skills reload
    
  • Claude Code, Copilot, Cursor, etc.: Point your agent to the instructions in the skill repository. The clear, imperative instructions help any LLM-based agent understand the CLI's nuances, headless requirements, and credential handling.

Now you can just delegate your King of Time tasks to your favorite AI assistant!

Options

All commands support these shared options:

  • -c, --config PATH: Path to config.toml.
  • -b, --browser BROWSER: Browser to use (firefox, chrome, edge, safari).
  • --month MONTH: Month number (1-12).
  • -y, --auto: Skip runtime confirmations.
  • --headless: Run browser in headless mode.
  • --visible: Run browser in visible mode.

For holiday specifically:

  • --no-cache: Force fresh data fetch from King of Time.
  • --text: Output as simple text lines.
  • --json: Output as JSONL.

Output Redirection

In headless mode, status and progress messages are sent to stderr, while actual data results (like holiday lists) and interactive prompts are sent to stdout. This allows you to redirect logs without losing the output:

kot-attendance-bot holiday --json 2>/dev/null > holidays.jsonl

Contribution

Setup for Development

This project uses uv for dependency management.

uv sync

Running Tests

uv run python -m unittest discover -s tests

Local Execution

uv run python main.py [command] [options]

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

kot_attendance_bot-1.0.2.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

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

kot_attendance_bot-1.0.2-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file kot_attendance_bot-1.0.2.tar.gz.

File metadata

  • Download URL: kot_attendance_bot-1.0.2.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kot_attendance_bot-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2d6f7bf51ff559fb115cb0490b347e3331b9e84731cabdd7f55f2ed3f377c53c
MD5 3ca4a024883b3c75bbbc1b91e221a630
BLAKE2b-256 0862c6fd447940a579bbb6919207808ec5b997c792045aafee9bf9878070599d

See more details on using hashes here.

File details

Details for the file kot_attendance_bot-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: kot_attendance_bot-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kot_attendance_bot-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 431a525914427eafca018899ee13ff6883e3cb1ef8c2ec1860e4834cc8d7189c
MD5 74686db622f2876a593b08f10f3d5fa7
BLAKE2b-256 ad8d65bbe8e3149982a3c8de92d81c36c6d98fb8f4b634b70f48537e8aa15344

See more details on using hashes here.

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