This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Platform_utils is a cross-platform Python library that provides utilities for:
- Path manipulation (application data paths, frozen app detection, cross-platform paths)
- Clipboard operations (get/set text)
- User idle time detection (Windows)
- Process management (killing processes)
- Shell integration (Windows context menu)
- Output suppression for py2exe
This project uses uv as the package manager and build tool with hatchling as the build backend.
Building the package:
uv buildRunning tests:
uv run python -m unittest discover -s testsRunning a specific test:
uv run python -m unittest tests.test_paths
uv run python -m unittest tests.test_paths.TestModulePath.test_module_pathInstalling in development mode:
uv syncPublishing (for releases):
uv publishThe library is organized into focused modules:
paths.py- Core path utilities using platformdirs library with Windows-specific extensions via_winpaths.pyclipboard.py- Cross-platform clipboard operations with Windows (pywin32) and Unix (subprocess) implementationsidle.py- Windows user idle time detection using win32apiprocess.py- Process management utilitiesblackhole.py- stdout/stderr suppression for py2exeshell_integration/- Windows shell context menu integration
Platform detection is handled centrally in paths.py with is_windows, is_mac, is_linux flags and is_frozen() for detecting packaged applications.
- platformdirs - Cross-platform directory utilities
- pywin32 - Windows-specific APIs (Windows only)
Tests use Python's built-in unittest framework and are located in the tests/ directory. Currently only test_paths.py exists with cross-platform path testing.
Releases are automated via GitHub Actions when tags are pushed. The workflow uses uv to build and publish to PyPI.