Skip to main content

Get info about your CPU

Project description

cpumodel

A Python library to parse and return various attributes from the CPU string

It has only been tested on relatively modern AMD and Intel CPUs that are likely to still be in use, i.e. AMD Ryzen, AMD EPYC, Intel i-series, Intel Xeon E3/E5 and newer. Other CPUs may or may not produce useful output.

If you want to request support for an unsupported CPU or if you see a bug in the output, see the Contributing section.

Installation

pip install cpumodel

Usage

As a library

from cpumodel imnport get_cpu_model

info = get_cpu_model()

As a script

$ cpumodel
{'cpuVendor': 'AMD', 'cpuString': 'AMD Ryzen 7 5700G', 'cpuModel': 'Ryzen 7 5700G', 'cpuFamily': 'Ryzen 7', 'cpuGeneration': '5', 'cpuLetter': 'G'}

Output

This library returns up to 6 values (it is possible for values to be None)

  • cpuVendor, the CPU vendor, e.g. Intel
  • cpuString, the full model string of the CPU, e.g. Intel Core i7-6700S
  • cpuModel, the shorter model name of the CPU, e.g. Core i7-6700S
  • cpuFamily, the concise family name of the CPU, e.g. Core i7
  • cpuGeneration, the numeric generation of the CPU, e.g. 6
  • cpuLetter, any trailing letter codes for this CPU, e.g. S

Examples

The best explanation of the data returned is probably by giving various examples.

cpuVendor cpuString cpuModel cpuFamily cpuGeneration cpuLetter
AMD AMD Ryzen 7 5700G Ryzen 7 5700G Ryzen 7 5 G
Intel 12th Gen Intel Core i7-1265U Core i7-1265U Core i7 12 U
Intel Intel Core i5-6300U Core i5-6300U Core i5 6 U

Contribution

If this library doesn't work properly on your CPU, it's probably because I've never tested on a CPU of that type.

Please open an issue, and describe what you would expect the output of this module to be, and include the output of this command:

grep 'model name' /proc/cpuinfo | sort -u

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

cpumodel-0.0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

cpumodel-0.0.1-py3-none-any.whl (5.5 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