Skip to content

python lib that parse the output of dmidecode

License

Notifications You must be signed in to change notification settings

luboss/py-dmidecode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-dmidecode

Small tool that parses ouput of dmidecode command

How to use

from dmidecode import DMIDecode
import subprocess

# create parsing instance by passing dmidecode output
dmi = DMIDecode()

# some of the pre-defined queries
print('Manufacturer:\t', dmi.manufacturer())
print('Model:\t\t', dmi.model())
print('Firmware:\t', dmi.firmware())
print('Serial number:\t', dmi.serial_number())
print('Processor type:\t', dmi.cpu_type())
print('Number of CPUs:\t', dmi.cpu_num())
print('Cores count:\t', dmi.total_enabled_cores())
print('Total RAM:\t{} GB'.format(dmi.total_ram()))

Alternatively instead of running dmidecode locally you can use DMIParse by passing dmidecode output as an argument:

from dmidecode import DMIParse
dmi = DMIParse(raw)

Other information can be easily retrieved by analyzing dmi.data and module code.

Possible limitations

Tested with dmidecode versions 2.11, 2.12 and 3.2

About

python lib that parse the output of dmidecode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.4%
  • Makefile 3.6%