Skip to main content

python lib that parse the output of dmidecode

Project description


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 and module code.

Possible limitations

Tested with dmidecode versions 2.11, 2.12 and 3.2

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for py-dmidecode, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size py_dmidecode-0.1.0-py3-none-any.whl (8.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size py-dmidecode-0.1.0.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page