Registry / devops / os-traits

os-traits

JSON →
library3.8.0pypypi✓ verified 83d ago

A library containing standardized trait strings for libvirt domain capabilities, used to represent CPU features, hypervisor capabilities, and other traits. Current version: 3.6.0. Released ~1-2 times per year.

pip install os-traits
INSTALL
IMPORT
SIG · OS-TRAITS
O
os-traits
devopspythonv3.8.0
Install
1.9s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.000s · 20MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

COMPUTE_ACCELERATORS
from os_traits import COMPUTE_ACCELERATORS
from os_traits import trait_names

List all trait names and check for a specific trait.

from os_traits import trait_names, TRAITS # List all trait names print(trait_names) # Check if a certain trait exists if 'HW_CPU_X86_SSE' in TRAITS: print('SSE trait exists') # Get trait name by value (if needed) def get_trait_name(value): for name, val in TRAITS.items(): if val == value: return name return None print(get_trait_name(1))
Debug
Known issues
breakingTrait values are not guaranteed to be stable between releases. Do not hardcode numeric trait values; always use the symbolic names.
fix
Use TRAITS dict to map from name to value, or use trait_names list for iteration.
affects: all
gotchaThe package name on PyPI is os-traits (hyphen), but the Python import uses underscore: os_traits. This is a common source of error.
fix
Install with pip install os-traits, but import with import os_traits.
affects: all
deprecatedSome traits may be deprecated in favor of new naming conventions (e.g., 'CPU_*' vs 'HW_CPU_*'). Always check the latest trait list.
fix
Refer to the official trait documentation for the latest naming.
affects: >=3.0.0
Upgrade
Version history
3.8.0latest on PyPI · released Jun 9, 2026
Audit
Dependencies
pbroptionalBuild dependency (setuptools plugin). Not a runtime dependency but required for setup.py install from source.
Agent activity
41 hits · last 30 days
node
38
OpenAI (training)
1
Resources
os-traits — pip install os-traits · libregistry