Socket
Socket
Sign inDemoInstall

systeminfo-python3

Package Overview
Dependencies
3
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

systeminfo-python3

A package that provides system information for your device.

    0.1.1

Maintainers
1

Readme

SystemInfo Package

This Python package provides a simple and easy-to-use way to gather system information, including details about the operating system, CPU, GPU (if available), and disk usage. The package uses popular Python libraries such as platform, psutil, socket, cpuinfo, and GPUtil to retrieve and present the system data.

Installation

pip install systeminfo-python3

Usage

To use the package, you can follow these steps:

  1. Import the SystemInfo class from the package:
from Systeminfo.system_Info import SystemInfo
  1. Create an instance of the SystemInfo class:
system_info = SystemInfo()
  1. Get all the information using the get_all_info() method:
all_info = system_info.get_all_info()
  1. Print the system information:
print("===== System Information =====")
for key, value in all_info["System Information"].items():
    print(f"{key}: {value}")
  1. Print the CPU information:
print("\n===== CPU Information =====")
for key, value in all_info["CPU Information"].items():
    print(f"{key}: {value}")
  1. Print the GPU information if available:
if "GPU Information" in all_info:
    print("\n===== GPU Information =====")
    for gpu_info in all_info["GPU Information"]:
        for key, value in gpu_info.items():
            print(f"{key}: {value}")
  1. Print the disk information:
print("\n===== Disk Information =====")
for disk_info in all_info["Disk Information"]:
    for key, value in disk_info.items():
        print(f"{key}: {value}")
    print("-------")

Example

Here's an example of how to use the package to retrieve and print system information:

from Systeminfo.system_Info import SystemInfo

# Create an instance of the SystemInfo class
system_info = SystemInfo()

# Get all the information using the SystemInfo class
all_info = system_info.get_all_info()

# Print the system information
print("===== System Information =====")
for key, value in all_info["System Information"].items():
    print(f"{key}: {value}")

# Print the CPU information
print("\n===== CPU Information =====")
for key, value in all_info["CPU Information"].items():
    print(f"{key}: {value}")

# Print the GPU information if available
if "GPU Information" in all_info:
    print("\n===== GPU Information =====")
    for gpu_info in all_info["GPU Information"]:
        for key, value in gpu_info.items():
            print(f"{key}: {value}")

# Print the disk information
print("\n===== Disk Information =====")
for disk_info in all_info["Disk Information"]:
    for key, value in disk_info.items():
        print(f"{key}: {value}")
    print("-------")

Dependencies

The package relies on the following external Python libraries:

  • platform: Provides access to the underlying platform's identifying data.
  • psutil: Offers system and process-related information.
  • socket: Provides access to network communication capabilities.
  • cpuinfo: Provides information about the CPU (Central Processing Unit).
  • GPUtil: Allows retrieving GPU (Graphics Processing Unit) information (optional).

Compatibility

The package is compatible with Python 3.9 and above.

License

This package is released under the MIT License. You are free to use, modify, and distribute it as per the terms of the license.

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc