Skip to main content

CLI and optional macOS menu bar app for Keka attendance tracking.

Project description

Keka Log

A Python package for checking and tracking Keka attendance. Includes a CLI tool and a Mac menu bar app to keep track of your shift time.

Prerequisites & Configuration (.zshrc)

Before using this tool, you need to extract your KEKA_TOKEN from your browser and configure it in your shell.

1. Get your Keka Token

  1. Log in to your Keka portal in your web browser.
  2. Open Developer Tools (Inspect Element) -> Network tab.
  3. Refresh the page or navigate to the attendance section.
  4. Look for an API request (e.g., summary or attendance).
  5. Check the Request Headers for the Authorization header. It will look like Bearer eyJ....
  6. Copy the long token string (everything after Bearer ).

2. Add to your .zshrc

You need to configure the token and your preferred notification language in your shell configuration file (e.g., ~/.zshrc).

  1. Open your .zshrc file in your terminal:
    nano ~/.zshrc
    
  2. Add the following lines at the bottom of the file:
    # Keka Attendance App Configuration
    export KEKA_TOKEN="paste_your_copied_token_here"
    
    # Optional: Set notification audio language ('hindi', 'telugu', or 'none')
    # Defaults to 'hindi' if not set. Use 'none' to disable audio entirely.
    export KEKA_LANGUAGE="telugu"
    
  3. Save the file (in nano: Ctrl+O, Enter, Ctrl+X) and reload your configuration:
    source ~/.zshrc
    

Installation

From PyPI (recommended)

Install the CLI from PyPI (replace the version if you pin one):

python3 -m venv .venv
source .venv/bin/activate
pip install keka-log

On macOS, install with the menubar extra so keka-menubar works (pulls in rumps and its dependencies):

pip install keka-log[menubar]

The base package has no third-party dependencies; only keka-log[menubar] adds the menu bar stack.

Without a virtual environment (direct install)

Yes — you can install normally with pip into your user account or system Python, no .venv required.

CLI only:

pip3 install keka-log

macOS menu bar as well:

pip3 install "keka-log[menubar]"

On macOS with Homebrew Python (and some Linux distros), plain pip install may be blocked with externally-managed-environment. In that case install into your user site-packages instead:

pip3 install --user "keka-log[menubar]"

Make sure your shell can find the scripts. User installs usually put executables under ~/.local/bin. If keka-log is not found, add this to ~/.zshrc and open a new terminal:

export PATH="$HOME/.local/bin:$PATH"

Alternative — isolated apps without managing a venv yourself: use pipx (install with brew install pipx on macOS, then pipx ensurepath):

pipx install "keka-log[menubar]"

That installs the package in its own environment and puts keka-log / keka-menubar on your PATH.

From a local clone

With a venv (good for development):

cd path/to/quid-keka-log
python3 -m venv .venv
source .venv/bin/activate
pip install ".[menubar]"   # macOS: CLI + menubar
# or
pip install .              # CLI only (no rumps)

Or install directly from the folder without a venv:

cd path/to/quid-keka-log
pip3 install --user ".[menubar]"

If you use a venv, run source .venv/bin/activate in each new terminal session where you want those commands.

Publishing a new release (maintainers)

  1. Bump version in pyproject.toml (and optionally keka_log/__init__.py).
  2. Build and upload to PyPI (use API tokens, not your password):
pip install build twine
python -m build
twine upload dist/*

For TestPyPI first:

twine upload --repository testpypi dist/*

Then install with:

pip install -i https://test.pypi.org/simple/ keka-log

Usage

If you installed inside a virtual environment, activate it first:

source .venv/bin/activate

If you installed with pip install --user, pipx, or a system pip3 install, you do not need a venv — open a normal terminal (ensure ~/.local/bin is on your PATH if you used --user).

Run and stop commands

What Run Stop
CLI (one-shot print) keka-log Nothing to stop — it exits after printing.
CLI (refresh cache) keka-log refresh Same — exits when done.
Menu bar app (stays running) keka-menubar See Stopping the menu bar app below.

Stopping the menu bar app (keka-menubar keeps running until you quit):

  1. From the menu bar (recommended): Click the Keka item in the top-right menu bar → Quit.

  2. If you started it in a terminal and that window is still open: focus that terminal and press Ctrl+C.

  3. From another terminal (if you closed the window or need to force-quit):

    pkill -f keka-menubar
    

    If nothing matches, list Python processes and stop the one running the app:

    ps aux | grep -i keka
    kill <PID>
    

    Replace <PID> with the process id from the ps output.


1. CLI tool

Print current attendance info, effective hours, and optimistic logout time:

keka-log

Refresh cached data from the Keka server:

keka-log refresh

2. Mac menu bar app (requires pip install keka-log[menubar])

Start the live countdown in the macOS menu bar:

keka-menubar

This shows a timer in the menu bar. When your shift is complete, it can play audio (unless KEKA_LANGUAGE=none) and show a notification. Use Quit in the menu or the stop commands above when you are done for the day.

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

keka_log-0.1.0.tar.gz (194.8 kB view details)

Uploaded Source

Built Distribution

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

keka_log-0.1.0-py3-none-any.whl (191.8 kB view details)

Uploaded Python 3

File details

Details for the file keka_log-0.1.0.tar.gz.

File metadata

  • Download URL: keka_log-0.1.0.tar.gz
  • Upload date:
  • Size: 194.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for keka_log-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb5ff666b3f98b2c10d802947acf5ec99146fdf3e1fdfc19730997f348861f41
MD5 9a5948b656dcd70f42af43a2875cc8e2
BLAKE2b-256 b592669d7ab47df764b648937ef2fadd1e94af55ae835e8d0a3c836d00ff28db

See more details on using hashes here.

File details

Details for the file keka_log-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: keka_log-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 191.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for keka_log-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c06e91eff980735d1fd7258e54b1d027693f89ee7440d540ffe8894f04334441
MD5 610764080e93d2d59b2593d551be3953
BLAKE2b-256 eaede11f1a7e6e87ed8a2f818127110d24cdee21c6897b8994c2cb748d611e3e

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