{"library":"pyghmi","title":"Pyghmi: Python General Hardware Management Initiative","description":"Pyghmi is a pure Python implementation of the Intelligent Platform Management Interface (IPMI) protocol, also supporting other hardware management initiatives. It enables programmatic control over server hardware, including power management, sensor monitoring, and console redirection (SOL). The library is actively maintained as part of OpenStack projects, with the current version 1.6.15 released on April 10, 2026, indicating a regular release cadence.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install pyghmi"],"cli":null},"imports":["from pyghmi.ipmi import command","from pyghmi.ipmi import bmc"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pyghmi.ipmi import command\n\n# Environment variables for BMC connection\nBMC_IP = os.environ.get('PYGHMI_BMC_IP', '192.168.1.100')\nBMC_USER = os.environ.get('PYGHMI_BMC_USER', 'admin')\nBMC_PASS = os.environ.get('PYGHMI_BMC_PASSWORD', 'password')\n\ntry:\n    # Establish an IPMI command session\n    # The `command.Command` object automatically manages session lifecycle.\n    ipmi_cmd = command.Command(\n        bmc=BMC_IP,\n        userid=BMC_USER,\n        password=BMC_PASS\n    )\n\n    print(f\"Connected to BMC at {BMC_IP}...\")\n\n    # Get power state\n    power_state = ipmi_cmd.get_power_state()\n    print(f\"Power State: {power_state['powerstate']}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure PYGHMI_BMC_IP, PYGHMI_BMC_USER, and PYGHMI_BMC_PASSWORD environment variables are set correctly.\")\n    print(\"Also verify network connectivity to the BMC and correct IPMI port (default 623).\")","lang":"python","description":"This quickstart demonstrates how to establish a connection to an IPMI BMC and retrieve its current power state using `pyghmi`. It relies on environment variables for BMC IP address, username, and password for secure configuration. The `command.Command` object manages the IPMI session lifecycle automatically.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.6.16","pypi_latest":"1.6.16","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.7,"avg_import_s":0.3,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.26,"mem_mb":11.4,"disk_size":"37.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.2,"mem_mb":11.4,"disk_size":"38M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.37,"mem_mb":12.4,"disk_size":"40.2M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.35,"mem_mb":12.4,"disk_size":"41M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.31,"mem_mb":12.3,"disk_size":"31.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.4,"import_time_s":0.32,"mem_mb":12.3,"disk_size":"32M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.32,"mem_mb":12.4,"disk_size":"31.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.4,"import_time_s":0.32,"mem_mb":12.4,"disk_size":"32M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.25,"mem_mb":11.2,"disk_size":"37.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyghmi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.4,"import_time_s":0.3,"mem_mb":11.2,"disk_size":"38M"}]}}