Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Extended, cached CPU info with consistent output format.
Consistent output format of memory-related values (unlike backend 'py-cpuinfo' package). Provides additional information. Provides cached instance (backend 'py-cpuinfo' package requires several seconds per an each call to gather CPU information).
pip install cengal_cpu_info
from cengal_cpu_info import cpu_info, CpuInfo
ci: CpuInfo = cpu_info()
print(f'{ci.is_arm=}')
print(f'{ci.is_x86=}')
print(f'{ci.cores_num=}')
print(f'{ci.virtual_cores_num=}')
print(f'{ci.l2_cache_size_per_core=}')
print(f'{ci.l2_cache_size_per_virtual_core=}')
print(f'{ci.l3_cache_size_per_core=}')
print(f'{ci.l3_cache_size_per_virtual_core=}')
print(f'{ci.arch=}')
print(f'{ci.arch_string_raw=}')
print(f'{ci.bits=}')
print(f'{ci.brand_raw=}')
print(f'{ci.count=}')
print(f'{ci.cpuinfo_version=}')
print(f'{ci.cpuinfo_version_string=}')
print(f'{ci.family=}')
print(f'{ci.flags=}')
print(f'{ci.hardware_raw=}')
print(f'{ci.hz_actual=}')
print(f'{ci.hz_actual_friendly=}')
print(f'{ci.hz_advertised=}')
print(f'{ci.l1_data_cache_size=}')
print(f'{ci.l1_instruction_cache_size=}')
print(f'{ci.l2_cache_associativity=}')
print(f'{ci.l2_cache_line_size=}')
print(f'{ci.l2_cache_size=}')
print(f'{ci.l3_cache_size=}')
print(f'{ci.model=}')
print(f'{ci.processor_type=}')
print(f'{ci.python_hz_advertised_friendlyversion=}')
print(f'{ci.python_version=}')
print(f'{ci.stepping=}')
print(f'{ci.vendor_id_raw=}')
ci.is_arm=False
ci.is_x86=True
ci.cores_num=4
ci.virtual_cores_num=4
ci.l2_cache_size_per_core=262144
ci.l2_cache_size_per_virtual_core=262144
ci.l3_cache_size_per_core=1572864
ci.l3_cache_size_per_virtual_core=1572864
ci.arch='X86_64'
ci.arch_string_raw='x86_64'
ci.bits=64
ci.brand_raw='Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz'
ci.count=4
ci.cpuinfo_version=[9, 0, 0]
ci.cpuinfo_version_string='9.0.0'
ci.family=6
ci.flags=['aes', 'apic', 'arch_capabilities', 'arch_perfmon', 'avx', 'clflush', 'cmov', 'constant_tsc', 'cpuid', 'cx16', 'cx8', 'de', 'erms', 'f16c', 'flush_l1d', 'fpu', 'fsgsbase', 'fxsr', 'ht', 'hypervisor', 'ibpb', 'ibrs', 'lahf_lm', 'lm', 'mca', 'mce', 'md_clear', 'mmx', 'msr', 'mtrr', 'nopl', 'nx', 'osxsave', 'pae', 'pat', 'pcid', 'pclmulqdq', 'pdcm', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'pti', 'rdrand', 'rdrnd', 'rdtscp', 'rep_good', 'sep', 'smep', 'ss', 'ssbd', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', 'stibp', 'syscall', 'tsc', 'vme', 'xsave', 'xsaveopt', 'xtopology']
ci.hardware_raw=''
ci.hz_actual=[3403348000, 0]
ci.hz_actual_friendly='3.4033 GHz'
ci.hz_advertised=[3400000000, 0]
ci.l1_data_cache_size=131072
ci.l1_instruction_cache_size=131072
ci.l2_cache_associativity=6
ci.l2_cache_line_size=256
ci.l2_cache_size=1048576
ci.l3_cache_size=6291456
ci.model=58
ci.processor_type=0
ci.python_hz_advertised_friendlyversion='3.4000 GHz'
ci.python_version='3.8.10.final.0 (64 bit)'
ci.stepping=9
ci.vendor_id_raw='GenuineIntel'
Represents part of Cengal library:
An equivalent import:
from cengal.hardware.info.cpu import cpu_info, CpuInfo
Cengal library can be installed by:
pip install cengal
Copyright © 2012-2023 ButenkoMS. All rights reserved.
Licensed under the Apache License, Version 2.0.
FAQs
Extended, cached CPU info with consistent output format
We found that cengal-cpu-info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.