winfacilityfetch 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- winfacilityfetch-0.1/PKG-INFO +6 -0
- winfacilityfetch-0.1/setup.cfg +4 -0
- winfacilityfetch-0.1/setup.py +11 -0
- winfacilityfetch-0.1/winfacilityfetch/__init__.py +1 -0
- winfacilityfetch-0.1/winfacilityfetch/core.py +107 -0
- winfacilityfetch-0.1/winfacilityfetch.egg-info/PKG-INFO +6 -0
- winfacilityfetch-0.1/winfacilityfetch.egg-info/SOURCES.txt +8 -0
- winfacilityfetch-0.1/winfacilityfetch.egg-info/dependency_links.txt +1 -0
- winfacilityfetch-0.1/winfacilityfetch.egg-info/requires.txt +2 -0
- winfacilityfetch-0.1/winfacilityfetch.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import *
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import platform
|
|
3
|
+
import psutil
|
|
4
|
+
import cpuinfo
|
|
5
|
+
import socket
|
|
6
|
+
|
|
7
|
+
# CPU
|
|
8
|
+
def cpu():
|
|
9
|
+
"""
|
|
10
|
+
Função para puxar a cpu do pc
|
|
11
|
+
- Exemplo de uso:
|
|
12
|
+
> import winfacilityfetch as wf
|
|
13
|
+
> cpu = wf.cpu()
|
|
14
|
+
> print(cpu)
|
|
15
|
+
"""
|
|
16
|
+
cpu = f"Cpu: {cpuinfo.get_cpu_info()['brand_raw']}"
|
|
17
|
+
return cpu
|
|
18
|
+
|
|
19
|
+
# RAM
|
|
20
|
+
def ram():
|
|
21
|
+
"""
|
|
22
|
+
Função para puxar a ram total do pc
|
|
23
|
+
- Exemplo de uso:
|
|
24
|
+
> import winfacilityfetch as wf
|
|
25
|
+
> ram = wf.ram()
|
|
26
|
+
> print(ram)
|
|
27
|
+
"""
|
|
28
|
+
ram = f"Ram: {round(psutil.virtual_memory().total / (1024**3), 2)}"
|
|
29
|
+
return ram
|
|
30
|
+
|
|
31
|
+
# Windows
|
|
32
|
+
def windows():
|
|
33
|
+
"""
|
|
34
|
+
Função para puxar o windows
|
|
35
|
+
- Exemplo de uso:
|
|
36
|
+
> import winfacilityfetch as wf
|
|
37
|
+
> windows = wf.windows()
|
|
38
|
+
> print(windows)
|
|
39
|
+
"""
|
|
40
|
+
windows = f"Windows: {platform.system()} {platform.release()}"
|
|
41
|
+
return windows
|
|
42
|
+
|
|
43
|
+
# Hostname
|
|
44
|
+
def pc_name():
|
|
45
|
+
"""
|
|
46
|
+
Função para puxar o HostName (Nome do pc)
|
|
47
|
+
- Exempo de uso:
|
|
48
|
+
> import winfacilityfetch as wf
|
|
49
|
+
> pc_name = wf.pc_name()
|
|
50
|
+
> print(pc_name)
|
|
51
|
+
"""
|
|
52
|
+
pc_name = f"Pc name: {socket.gethostname()}"
|
|
53
|
+
return pc_name
|
|
54
|
+
|
|
55
|
+
# GPU
|
|
56
|
+
def gpu():
|
|
57
|
+
"""
|
|
58
|
+
Função para puxar a gpu
|
|
59
|
+
- Exemplo de uso:
|
|
60
|
+
> import winfacilityfetch as wf
|
|
61
|
+
> gpu = wf.gpu()
|
|
62
|
+
> print(gpu)
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
gpu_cmd = "wmic path win32_VideoController get name"
|
|
66
|
+
gpu_output = subprocess.check_output(gpu_cmd, shell=True).decode()
|
|
67
|
+
|
|
68
|
+
gpu_lines = [line.strip() for line in gpu_output.splitlines() if line.strip()]
|
|
69
|
+
gpu = f"Gpu: {gpu_lines[1]}"
|
|
70
|
+
return gpu
|
|
71
|
+
|
|
72
|
+
# Disco
|
|
73
|
+
def disk():
|
|
74
|
+
"""
|
|
75
|
+
Função para puxar o uso do disco, o espaço total, a porcentagem de uso e o espaço livre
|
|
76
|
+
- Exemplo de uso:
|
|
77
|
+
> import winfacilityfetch as wf
|
|
78
|
+
> disk = wf.disk()
|
|
79
|
+
> print(disk)
|
|
80
|
+
"""
|
|
81
|
+
disk = f"{round(psutil.disk_usage('/').used / (1024**3))}GB/{round(psutil.disk_usage('/').total / (1024**3))}GB ({psutil.disk_usage('/').percent}%, {round(psutil.disk_usage('/').free / (1024**3))}GB livres)"
|
|
82
|
+
return disk
|
|
83
|
+
|
|
84
|
+
# Uso de cpu
|
|
85
|
+
def cpu_usage():
|
|
86
|
+
"""
|
|
87
|
+
Função para puxar o uso da cpu
|
|
88
|
+
- Exemplo de uso:
|
|
89
|
+
> import winfacilityfetch as wf
|
|
90
|
+
> cpu_usage = wf.cpu_usage()
|
|
91
|
+
> print(cpu_usage)
|
|
92
|
+
"""
|
|
93
|
+
cpu_usage = f"Cpu usage: {psutil.cpu_percent(interval=1)}%"
|
|
94
|
+
return cpu_usage
|
|
95
|
+
|
|
96
|
+
# RAM
|
|
97
|
+
def ram_usage():
|
|
98
|
+
"""
|
|
99
|
+
Função para puxar a quantidade de ram que o pc está usando.
|
|
100
|
+
- Exemplo de uso:
|
|
101
|
+
> import winfacilityfetch as wf
|
|
102
|
+
> ram_usage = wf.ram_usage()
|
|
103
|
+
> print(ram_usage) # O "Ram usage: " já vem na variavel da biblioteca, ou seja, não precisa colocar ele junto no print
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
ram_usage = f"Ram usage: {psutil.virtual_memory().percent}"
|
|
107
|
+
return ram_usage
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
winfacilityfetch/__init__.py
|
|
3
|
+
winfacilityfetch/core.py
|
|
4
|
+
winfacilityfetch.egg-info/PKG-INFO
|
|
5
|
+
winfacilityfetch.egg-info/SOURCES.txt
|
|
6
|
+
winfacilityfetch.egg-info/dependency_links.txt
|
|
7
|
+
winfacilityfetch.egg-info/requires.txt
|
|
8
|
+
winfacilityfetch.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
winfacilityfetch
|