Skip to content

Commit

Permalink
a new and more stable update, and now have an executable: systeminspe…
Browse files Browse the repository at this point in the history
…ctV0.1.1
  • Loading branch information
kefaslungu committed Mar 1, 2023
1 parent da0c019 commit 7c21f10
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exe_compiler/
26 changes: 19 additions & 7 deletions pc_info/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# __init__.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu
__author__ = """kefaslungu"""
__email__ = 'jameskefaslungu@gmail.com'
__version__ = '0.1.1'

from pc_info import battery
from pc_info import bios
from pc_info import cpu
from pc_info import disks
from pc_info import memory_converter
from pc_info import motherboard
from pc_info import ram
from pc_info import(
basic_info,
battery,
bios,
cpu,
disks,
memory_converter,
motherboard ,
ram,
sound,
startup
)
30 changes: 30 additions & 0 deletions pc_info/basic_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# basic_info.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import wmi

def basicInfo():
"""Provides all the necessary basic information about your operating system, and your hard ware."""
c = wmi.WMI()
for win in c.Win32_OperatingSystem():
os_info = (f"OS name: {win.Caption}.\n"
f"OS Manufacturer: {win.Manufacturer}.\n"
f"Version: {win.Version}.\n"
f"Build number: {win.BuildNumber}.\n"
f"Windows Serial number: {win.SerialNumber}.\n")

for computer in c.Win32_ComputerSystem():
pc_info = (f"Computer name: {computer.Name}.\n"
f"PC manufacturer: {computer.Manufacturer}.\n"
f"System model: {computer.Model}.\n"
f"System type: {computer.SystemType}.\n"
f"System family: {computer.SystemFamily}.\n"
f"System SKU: {computer.SystemSKUNumber}.\n"
f"Owner: {computer.PrimaryOwnerName}.\n"
f"DNSHostName: {computer.DNSHostName}.\n"
f"A Hypervisor is present: {computer.HypervisorPresent}.\n")
about_windows =f"{os_info}{pc_info}"
return about_windows

7 changes: 6 additions & 1 deletion pc_info/battery.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# battery.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import subprocess
import wmi
import psutil
import wx

def battery_information():
"""Provides information about your system's battery."""
battery = psutil.sensors_battery()
batteryInfo = {
"has_battery": str(subprocess.getoutput(["powershell", "@(Get-CimInstance -ClassName Win32_Battery).Count -gt 0 "])),
Expand Down
9 changes: 7 additions & 2 deletions pc_info/bios.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import wmi
import wx
# bios.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import subprocess
import wmi

def bios():
"""Provides information about your bios."""
bios_mode = subprocess.getoutput(["powershell","$env:firmware_type"])
c = wmi.WMI()
for bios in c.Win32_BIOS():
Expand Down
24 changes: 19 additions & 5 deletions pc_info/cpu.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#more work is comming to this module soon, not yet completed.
# cpu.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import subprocess
import wmi
import wx

def cpu_stats():
cpu = subprocess.getoutput('wmic cpu get name, caption, deviceid, numberofcores, status, maxclockspeed /format:list').replace('\n\n\n', '')
return cpu
"""Provides basic information about your cpu."""
c = wmi.WMI()
cpu_info = ''
for cpu in c.Win32_Processor():
cpu_info+=(f"CPU name: {cpu.Name}.\n"
f"Manufacturer: {cpu.Manufacturer}.\n"
f"Current clock speed: {cpu.CurrentClockSpeed}.\n"
f"Maximum clock speed: {cpu.MaxClockSpeed}.\n"
f" Number of cores: {cpu.NumberOfCores}.\n"
f"Number of enabled cores: {cpu.NumberOfEnabledCore}.\n"
f"Logical processors: {cpu.NumberOfLogicalProcessors}.\n"
f"Serial number: {cpu.ProcessorId}.\n"
f"Number of threads: {cpu.ThreadCount}.\n"
f"Architecture: {cpu.Architecture}.\n")
return cpu_info
6 changes: 5 additions & 1 deletion pc_info/disks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# disks.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import subprocess
import psutil
import wmi
import wx
#import memory_converter
def get_size(bytes):
"""
Expand Down
7 changes: 6 additions & 1 deletion pc_info/motherboard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import wx
# motherboard.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import wmi

def motherboard():
"""Gathers all information about your motherboard."""
c = wmi.WMI()
for board in c.Win32_BaseBoard():
motherboard_info = (f"Motherboard information:\n"
Expand Down
7 changes: 6 additions & 1 deletion pc_info/ram.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ram.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import subprocess
import wx
import psutil
import wmi

Expand All @@ -17,6 +21,7 @@ def get_size(bytes):
bytes /= factor

def ram_info():
"""Returns all information about your ram, from usage to hard ware information."""
memory_usage = psutil.virtual_memory()
technical_ram_info = ''
c = wmi.WMI()
Expand Down
15 changes: 15 additions & 0 deletions pc_info/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# pc_info.
part of System inspect.

This is the modules that contains all the necessary files that the program needs to access your computer and give you the proper information.

## They include:
* basic_info.py: Provides the general information about operating system and hard ware manifacturer.
* Battery.py: Provides information about system battery.
* bios.py: Provides information about system's bios.
* cpu.py: Provides information about computer's cpu.
* disks.py: Gives you detailed information on disk usage, and other stats like manifacturer and lots more.

and so on. Most of the files do as their names suggests.

Copyright © 2023 kefaslungu.
16 changes: 16 additions & 0 deletions pc_info/sound.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# sound.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import wmi

def sound():
"""Gathers information about the sound devices connected to this PC."""
sound_device = ''
for device in wmi.WMI().win32_SoundDevice():
sound_device += (f"Sound device: {device.Caption}.\n"
f"Device description: {device.Description}.\n"
f"Manufacturer: {device.Manufacturer}.\n"
f"Device ID: {device.DeviceID}.\n")
return sound_device
16 changes: 16 additions & 0 deletions pc_info/startup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# startup.py
# A part of System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import wmi

def startup():
"""Gets information on all items that start with windows."""
c = wmi.WMI()
startupItem = ''
for startup_item in c.Win32_StartupCommand():
startupItem += (f"Name: {startup_item.Name}.\n"
f"Command: {startup_item.Command}.\n"
f"Location: {startup_item.Location}.\n")
return startupItem
59 changes: 0 additions & 59 deletions pc_info/wx notebook.py

This file was deleted.

16 changes: 14 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# SystemInspect
by [Kefas Lungu.](https://github.com/kefaslungu)

SystemInspect is a program written in python, and a bit of powershell that provides information about a computer system. The program utilizes several functions to retrieve information about the computer's BIOS, CPU, hard disks, motherboard, and RAM. This information is presented in a notebook interface with a tab for each category.

The goal of SystemInspect is to provide users with an easy way to view important information about their computer system. The program is designed to be user-friendly and accessible to users of all technical backgrounds.

more functionality will be added in future releases.
## Requirements.
note: this section is intended for those who want to compile from source, without using the executable.

To run SystemInspect, you must have Python 3 and the following libraries installed:

* wxPython: the graphical user interface used in the whole of the program.
* wmi: this is used to access the windows management instrumentation.
* psutil: [process and system utilities]. This module is used in several places.

you can install all these modules by using pip.
## Usage:
To run SystemInspect, simply execute the `systeminspect.py` file. The program will open a notebook interface with tabs for each category of information. Click on each tab to view the corresponding information.
To run SystemInspect after all these modules are installed, simply execute the `systeminspect.py` file.

The program will open a notebook interface with tabs for each category of information. Click on each tab to view the corresponding information.

Please note that the information presented by SystemInspect may not be entirely accurate or up-to-date. Use this program at your own risk.
## Contributing:
If you would like to contribute to SystemInspect, please feel free to submit a pull request or [contact the developer.](jameskefaslungu@gmail.com)
Thank you for using SystemInspect!

Thank you for using SystemInspect!

Copyright © 2023 kefaslungu.
27 changes: 0 additions & 27 deletions systeminspect.py

This file was deleted.

45 changes: 45 additions & 0 deletions systeminspectV0.1.1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#System inspect
# This file is covered by the GNU General Public License.
# Copyright (C) 2023 kefaslungu

import wx
"""this is the main file for the System inspect utility. Please see the readme file for what it does."""
from pc_info import (
basic_info,
battery,
bios,
cpu,
disks,
motherboard,
ram,
sound,
startup
)

class Frame(wx.Frame):
"""This is the class that inherit the wx frame, and all other functions are written in this class, or is used to call other functions else wheree."""
def __init__(self):
super().__init__(None, wx.ID_ANY, title="System InspectV0.1.1 by Kefas Lungu")
self.pnl = wx.Panel(self)
self.pc_inspect(self.pnl)
self.Show(True)

def pc_inspect(self, parent):
"""This function collects all functions from the pc_info module, and creates a wx.Notebook instance for all the functions it can get"""
notebook = wx.Notebook(parent)
functions = ((basic_info.basicInfo(), 'basic windows information'), (battery.battery_information(), 'Battery information'), (bios.bios(), 'Bios information'), (cpu.cpu_stats(), 'Cpu information'), (disks.disk_info(), 'Disk information'), (motherboard.motherboard(), 'Motherboard information'), (ram.ram_info(), 'Ram information'), (sound.sound(), 'sound information'), (startup.startup(), 'Startup items'))
for handler, label in functions:
page = wx.Panel(notebook)
sizer = wx.BoxSizer(wx.VERTICAL)
text_ctrl = wx.TextCtrl(page, -1, value=handler, style=wx.TE_MULTILINE | wx.TE_READONLY)
sizer.Add(text_ctrl, 1, wx.EXPAND)
page.SetSizer(sizer)
notebook.AddPage(page, label)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(notebook, 1, wx.EXPAND)
parent.SetSizer(sizer)

if __name__ == '__main__':
app = wx.App()
frame = Frame()
app.MainLoop()

0 comments on commit 7c21f10

Please sign in to comment.