Skip to content

v0.18.3 - Pendulum Migration in history.py and monitor.py (2026-03-05)

What Changed?

This release replaces stdlib datetime with pendulum in history.py and monitor.py, and fixes a hardcoded "Asia/Tokyo" timezone in history.py. Both scripts now use get_timezone() for local timezone resolution, making them portable across different timezone environments.


What's New

Main Feature: Pendulum and get_timezone() in history.py and monitor.py

What it does:

  • history.py: timezone field now resolved via get_timezone() (was hardcoded "Asia/Tokyo"); timestamps use pendulum.now("UTC") and pendulum.parse() instead of stdlib datetime
  • monitor.py: detected timestamp conversion now uses pendulum.from_timestamp(..., tz=get_timezone()) instead of datetime.fromtimestamp(..., tz=timezone.utc).astimezone()

How to use it:

# Uses system timezone (default)
uv run history.py

# Override timezone via environment variable
KAZUNOKO_TZ=Europe/Paris uv run monitor.py ./data

Installation

Quick Start

# Get the release
git checkout 0.18.3

# Setup
uv sync

# Run CLI
uv run kazunoko --help

What's Different from the Last Version?

🔧 Changed

  • history.py: replaced hardcoded "Asia/Tokyo" with get_timezone() for the device timezone field
  • history.py: replaced datetime.now(timezone.utc) with pendulum.now("UTC") and datetime.fromisoformat() with pendulum.parse() in update_status()
  • history.py: replaced datetime.now("UTC").isoformat() with pendulum.now("UTC").isoformat() in __post_init__
  • monitor.py: replaced datetime.fromtimestamp(..., tz=timezone.utc).astimezone() with pendulum.from_timestamp(..., tz=get_timezone()) in render()

Is It Safe to Upgrade?

Backward Compatible: Yes

  • history.py: timezone field in saved JSONL now reflects system timezone instead of always "Asia/Tokyo" — set KAZUNOKO_TZ=Asia/Tokyo to preserve previous behavior explicitly
  • monitor.py: displayed timestamps now reflect local timezone via get_timezone() — no behavioral change for users already in Asia/Tokyo

Tests Passed

  • ✅ Builds without errors
  • ✅ uvx ruff check src/ passes
  • ✅ Pre-commit hooks pass

Release Details

  • Date: 2026-03-05
  • Version: v0.18.3
  • Files Changed: 2
  • Commits: 22642c4, 18843c6, 655d7d2

Next Steps

  • Consider exposing KAZUNOKO_TZ in the CLI as a global option