Skip to content

osn-system-utils v0.0.1

Choose a tag to compare

@oddshellnick oddshellnick released this 12 Jan 15:28
· 6 commits to main since this release

osn-system-utils v0.0.1 - Initial Release of Comprehensive System Management API

Welcome to the first official release of osn-system-utils. This library provides a unified, cross-platform interface for managing system processes, network sockets, and power states on both Linux and Windows environments. By wrapping complex CLI tools and leveraging psutil, we provide a developer-friendly way to interact with the underlying operating system.

Key Improvements in v0.0.1:

  1. Advanced Process Management Table: Introduced a powerful get_process_table function that generates a Pandas DataFrame of system processes. It supports deep-nested attribute fetching and a sophisticated filtering system, including regex, range checks (above/under/between), and equality filters.
  2. Flexible Port Allocation: The network API has been overhauled to support a wider port range (up to 65535). The new get_localhost_free_port_of utility allows for smart port hunting using "min", "max", or "random" strategies, making it easier to find available ports for local services.
  3. Cross-Platform Power & Process Control: We’ve implemented standardized wrappers for essential system commands. This includes shutdown and taskkill for Windows, and pkill, kill, and ss (Socket Statistics) for Linux, ensuring consistent behavior across different environments.
  4. Internal Validation Engine: Added a robust set of internal utility functions to handle nested dictionary/object traversal and parameter validation. This ensures that invalid inputs are caught early with descriptive error messages.
  5. Standardized Command Execution: Improved the core run_command utility to handle subprocess execution with better encoding support and custom exception handling through the new CommandExecutionError class.

Putting It All Together:
This release transforms raw system commands into a structured Python API. Whether you need to monitor localhost PIDs with their associated ports, generate a filtered list of running applications, or safely restart a remote Windows machine, osn-system-utils v0.0.1 provides the necessary tools with type-safe implementations and clear documentation.