cpumodel


Namecpumodel JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryGet info about your CPU
upload_time2023-06-15 14:54:21
maintainer
docs_urlNone
authorJonathan Gazeley
requires_python>=3.9,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```terminal
pip install cpumodel
```

## Usage

### As a library

```py
from cpumodel.cpumodel import get_cpu_model

info = get_cpu_model()
```

### As a script

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

You can optionally supply a CPU string with `-t` or `--test` which will cause cpumodel to parse this CPU
string rather than get the local system's CPU string. This is useful for testing the logic.

```terminal
$ cpumodel -t "Intel(R) Xeon(R) Gold 6234 CPU @ 3.30GHz"
{'cpuVendor': 'Intel', 'cpuString': 'Intel Xeon Gold 6234', 'cpuModel': 'Xeon Gold 6234', 'cpuFamily': 'Xeon Gold', 'cpuGeneration': '6'}
```

## 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` |
|-------------|--------------------------------|----------------------------|----------------------|-----------------|-------------|
| `Intel`     | `Intel Xeon Platinum 8358`     | `Xeon Platinum 8358`       | `Xeon Platinum`      | `8`             |             |
| `Intel`     | `Intel Xeon Gold 6226R`        | `Xeon Gold 6226R`          | `Xeon Gold`          | `6`             | `R`         |
| `Intel`     | `Intel Xeon E3-1220 v6`        | `Xeon E3-1220 v6`          | `Xeon E3`            | `6`             |             |
| `Intel`     | `Intel Celeron G1610`          | `Celeron G1610`            | `Celeron`            | `1`             | `G`         |
| `Intel`     | `Intel Core i5-6500T`          | `Core i5-6500T`            | `Core i5`            | `6`             | `T`         |
| `Intel`     | `Intel Core i9-9900K`          | `Core i9-9900K`            | `Core i9`            | `9`             | `K`         |
| `Intel`     | `Intel Core i9-10900`          | `Core i9-10900`            | `Core i9`            | `10`            |             |
| `Intel`     | `12th Gen Intel Core i7-1265U` | `Core i7-1265U`            | `Core i7`            | `12`            | `U`         |
| `Intel`     | `12th Gen Intel Core i9-12900` | `Core i9-12900`            | `Core i9`            | `12`            |             |
| `AMD`       | `AMD Ryzen 7 5700G`            | `Ryzen 7 5700G`            | `Ryzen 7`            | `5`             | `G`         |
| `AMD`       | `AMD Ryzen 7 PRO 5850U`        | `Ryzen 7 PRO 5850U`        | `Ryzen 7 PRO`        | `5`             | `U`         |
| `AMD`       | `AMD Ryzen 9 7950X`            | `Ryzen 9 7950X`            | `Ryzen 9`            | `7`             | `X`         |
| `AMD`       | `AMD Ryzen Threadripper 3990X` | `Ryzen Threadripper 3990X` | `Ryzen Threadripper` | `3`             | `X`         |
| `AMD`       | `AMD Athlon 5350 APU`          | `Athlon 5350 APU`          | `Athlon`             | `5`             |             |
| `AMD`       | `AMD Opteron 6366 HE`          | `Opteron 6366 H`           | `Opteron`            | `6366`          | `H`         |
| `AMD`       | `AMD EPYC 7551P`               | `EPYC 7551P`               | `EPYC`               | `7`             | `P`         |

## 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](https://github.com/djjudas21/cpumodel/issues), and describe what you would expect the
output of this module to be, and include the output of this command:

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cpumodel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jonathan Gazeley",
    "author_email": "me@jonathangazeley.com",
    "download_url": "https://files.pythonhosted.org/packages/ae/83/4593da762909fae7f2d76810f577d73a2ecfd4a4558c6761f3427f114907/cpumodel-0.0.3.tar.gz",
    "platform": null,
    "description": "# cpumodel\n\nA Python library to parse and return various attributes from the CPU string\n\nIt has only been tested on relatively modern AMD and Intel CPUs that are likely to still be in use,\ni.e. AMD Ryzen, AMD EPYC, Intel i-series, Intel Xeon E3/E5 and newer. Other CPUs may or may not produce\nuseful output.\n\nIf you want to request support for an unsupported CPU or if you see a bug in the output, see the\nContributing section.\n\n## Installation\n\n```terminal\npip install cpumodel\n```\n\n## Usage\n\n### As a library\n\n```py\nfrom cpumodel.cpumodel import get_cpu_model\n\ninfo = get_cpu_model()\n```\n\n### As a script\n\n```terminal\n$ cpumodel\n{'cpuVendor': 'AMD', 'cpuString': 'AMD Ryzen 7 5700G', 'cpuModel': 'Ryzen 7 5700G', 'cpuFamily': 'Ryzen 7', 'cpuGeneration': '5', 'cpuLetter': 'G'}\n```\n\nYou can optionally supply a CPU string with `-t` or `--test` which will cause cpumodel to parse this CPU\nstring rather than get the local system's CPU string. This is useful for testing the logic.\n\n```terminal\n$ cpumodel -t \"Intel(R) Xeon(R) Gold 6234 CPU @ 3.30GHz\"\n{'cpuVendor': 'Intel', 'cpuString': 'Intel Xeon Gold 6234', 'cpuModel': 'Xeon Gold 6234', 'cpuFamily': 'Xeon Gold', 'cpuGeneration': '6'}\n```\n\n## Output\n\nThis library returns up to 6 values (it is possible for values to be `None`)\n\n* `cpuVendor`, the CPU vendor, e.g. `Intel`\n* `cpuString`, the full model string of the CPU, e.g. `Intel Core i7-6700S`\n* `cpuModel`, the shorter model name of the CPU, e.g. `Core i7-6700S`\n* `cpuFamily`, the concise family name of the CPU, e.g. `Core i7`\n* `cpuGeneration`, the numeric generation of the CPU, e.g. `6`\n* `cpuLetter`, any trailing letter codes for this CPU, e.g. `S`\n\n## Examples\n\nThe best explanation of the data returned is probably by giving various examples.\n\n| `cpuVendor` | `cpuString`                    | `cpuModel`                 | `cpuFamily`          | `cpuGeneration` | `cpuLetter` |\n|-------------|--------------------------------|----------------------------|----------------------|-----------------|-------------|\n| `Intel`     | `Intel Xeon Platinum 8358`     | `Xeon Platinum 8358`       | `Xeon Platinum`      | `8`             |             |\n| `Intel`     | `Intel Xeon Gold 6226R`        | `Xeon Gold 6226R`          | `Xeon Gold`          | `6`             | `R`         |\n| `Intel`     | `Intel Xeon E3-1220 v6`        | `Xeon E3-1220 v6`          | `Xeon E3`            | `6`             |             |\n| `Intel`     | `Intel Celeron G1610`          | `Celeron G1610`            | `Celeron`            | `1`             | `G`         |\n| `Intel`     | `Intel Core i5-6500T`          | `Core i5-6500T`            | `Core i5`            | `6`             | `T`         |\n| `Intel`     | `Intel Core i9-9900K`          | `Core i9-9900K`            | `Core i9`            | `9`             | `K`         |\n| `Intel`     | `Intel Core i9-10900`          | `Core i9-10900`            | `Core i9`            | `10`            |             |\n| `Intel`     | `12th Gen Intel Core i7-1265U` | `Core i7-1265U`            | `Core i7`            | `12`            | `U`         |\n| `Intel`     | `12th Gen Intel Core i9-12900` | `Core i9-12900`            | `Core i9`            | `12`            |             |\n| `AMD`       | `AMD Ryzen 7 5700G`            | `Ryzen 7 5700G`            | `Ryzen 7`            | `5`             | `G`         |\n| `AMD`       | `AMD Ryzen 7 PRO 5850U`        | `Ryzen 7 PRO 5850U`        | `Ryzen 7 PRO`        | `5`             | `U`         |\n| `AMD`       | `AMD Ryzen 9 7950X`            | `Ryzen 9 7950X`            | `Ryzen 9`            | `7`             | `X`         |\n| `AMD`       | `AMD Ryzen Threadripper 3990X` | `Ryzen Threadripper 3990X` | `Ryzen Threadripper` | `3`             | `X`         |\n| `AMD`       | `AMD Athlon 5350 APU`          | `Athlon 5350 APU`          | `Athlon`             | `5`             |             |\n| `AMD`       | `AMD Opteron 6366 HE`          | `Opteron 6366 H`           | `Opteron`            | `6366`          | `H`         |\n| `AMD`       | `AMD EPYC 7551P`               | `EPYC 7551P`               | `EPYC`               | `7`             | `P`         |\n\n## Contribution\n\nIf this library doesn't work properly on your CPU, it's probably because I've never tested on a CPU of that type.\n\nPlease [open an issue](https://github.com/djjudas21/cpumodel/issues), and describe what you would expect the\noutput of this module to be, and include the output of this command:\n\n```sh\ngrep 'model name' /proc/cpuinfo | sort -u\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Get info about your CPU",
    "version": "0.0.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5e39ff2d1ea3064ccb735b8b152e2bd955cca92572c37efd3a0756c8d2ee45e",
                "md5": "b473b2e6151d455bae245731abcdb431",
                "sha256": "663336871ba18f00db5eee16140fd9fb525736e243e0aa425f2c247b5e4c7710"
            },
            "downloads": -1,
            "filename": "cpumodel-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b473b2e6151d455bae245731abcdb431",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 6190,
            "upload_time": "2023-06-15T14:54:19",
            "upload_time_iso_8601": "2023-06-15T14:54:19.702329Z",
            "url": "https://files.pythonhosted.org/packages/f5/e3/9ff2d1ea3064ccb735b8b152e2bd955cca92572c37efd3a0756c8d2ee45e/cpumodel-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae834593da762909fae7f2d76810f577d73a2ecfd4a4558c6761f3427f114907",
                "md5": "06b6f8820aa345bb79fd36e6a2943c41",
                "sha256": "8f37de1449b6fefa855d4316c15e4dc060a7ae63ff920122050e1d73f687f805"
            },
            "downloads": -1,
            "filename": "cpumodel-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "06b6f8820aa345bb79fd36e6a2943c41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 4670,
            "upload_time": "2023-06-15T14:54:21",
            "upload_time_iso_8601": "2023-06-15T14:54:21.732081Z",
            "url": "https://files.pythonhosted.org/packages/ae/83/4593da762909fae7f2d76810f577d73a2ecfd4a4558c6761f3427f114907/cpumodel-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-15 14:54:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cpumodel"
}
        
Elapsed time: 1.84945s