Skip to main content

Python utility to gather local system details and dump them to output as a JSON formatted string.

#!/usr/bin/python

import json
import os
import platform
import sys


system_details = {
    'os_name': os.name,
    'sys_platform': sys.platform,
    'platform_machine': platform.machine(),
    'platform_python_implementation': platform.python_implementation(),
    'platform_release': platform.release(),
    'platform_system': platform.system(),
    'platform_version': platform.version(),
    'python_version': platform.python_version()[:3],
    'python_full_version': platform.python_version()
}

if __name__ == '__main__':
    print(json.dumps(system_details, sort_keys=True))