Skip to main content

python lib that parse the output of dmidecode

Project description

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

Project details


Download files

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

Source Distribution

py-dmidecode-0.1.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

py_dmidecode-0.1.0-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page