Cpu-topology is a project mainly written in Python, based on the GPL-2.0 license.
A simple python script to display cpu topology information
cpu-topology.py is a simple python script that displays cpu topology information gathered from /sys/devices/system/cpu/cpu*/topology.
System appears to be uni-processor
CPU Topology (Hyperthreaded)
CPU 0 Threads: 2
Number of CPUs = 1 Number of threads = 2
CPU Topology (SMP)
CPU 0 CPU 1
Number of CPUs = 2
CPU Topology (Multicore)
CPU 0 Cores: 4
Number of CPUs = 1 Number of cores = 4
CPU Topology (SMP / Multicore)
CPU 0 Cores: 2 CPU 1 Cores: 2
Number of CPUs = 2 Number of cores = 4