Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed Dec 10, 2023
1 parent c417c69 commit 04723a9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# PySys
# PySys
Simple library to see your computer's spec information.
- CPU Core Count
- Swap, Total, and Used RAM
- OS Name
- More...
54 changes: 54 additions & 0 deletions pysys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import os
import platform
import psutil
import numpy as np


class CPU:
# CPU Core Count
def cpuCoreCount():
print(f"Core Count: {os.cpu_count()}")

# Processor/CPU Type
def processorType():
print(f"Processor: {platform.processor()}")

# Computer Architecture
def computerArchitecture():
print(f"Architecture: {platform.architecture()}")

# Physcial CPU Cores
def phyicalCoresCPU():
print(psutil.cpu_count(True))

# Logical CPU Cores
def logicalCoresCPU():
print(psutil.cpu_count(False))

# Overall CPU Usage
def CPUsage():
print(f"CPU Usage: {psutil.cpu_percent()}%")

class OSType:
def OS():
print(f"OS: {platform.system()}")

class RAM:
# Overall RAM Usage
def RAMUsage():
ram = np.round(psutil.virtual_memory().used/1000000000, 1)
totalRAM = np.round(psutil.virtual_memory().total/1000000000, 2)
swap = np.round(psutil.swap_memory().used/1000000000, 1)
print(f"RAM Usage: {ram} GB / {totalRAM} GB\nSwap Memory: {swap} GB")

def swapMemory():
swap = np.round(psutil.swap_memory().used/1000000000, 1)
print(f"Swap Memory: {swap} GB")

def totalRAM():
totalRAM = np.round(psutil.virtual_memory().total/1000000000, 2)
print(f"Total RAM: {totalRAM} GB")

def usedRAM():
usedRAM = np.round(psutil.virtual_memory().used/1000000000, 1)
print(f"Used RAM: {usedRAM} GB")

0 comments on commit 04723a9

Please sign in to comment.