archspec
A library to query system architecture
What it is and what it does
Archspec is a Python library that provides standardized, human-readable labels for system architecture components—primarily CPU microarchitectures—and APIs to detect, query, and reason about compatibility relationships between them. It grew out of Spack and exposes functionality to identify what CPU architecture a system has, compare microarchitectures for compatibility, and model relationships between different CPU families and generations.
The library has no runtime dependencies and installs cleanly on Python 3.6 and later. It is actively maintained and suitable for integration into package managers, build systems, or any tool that needs to understand and work with CPU architecture compatibility. While still in Alpha, it has been in development since 2020-02-02 and is used in production contexts.
Use it for:
- Detect the CPU microarchitecture of a system to select optimized binaries or build flags
- Compare microarchitectures to determine if a pre-built binary is compatible with a target system
- Model CPU compatibility chains in package managers to avoid installing incompatible optimized builds
- Query architecture metadata for system profiling or hardware inventory tools
- Reason about CPU feature sets and generations for compiler optimization decisions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Archspec provides APIs to detect, query, and compare CPU microarchitectures and other system architecture aspects using human-readable labels.
Yes, if you need CPU microarchitecture detection and compatibility reasoning. Low install friction, no dependencies, permissive dual licensing (Apache-2.0 OR MIT), and active maintenance make it a safe choice. Alpha status means the API may evolve, but the library is already in production use. Not needed if your tool doesn't care about CPU-level compatibility or microarchitecture details.
Install
archspec on PyPI
pip
pip install archspecuv
uv add archspecpoetry
poetry add archspecInstalling archspec
Before you install
Low friction installation with no runtime dependencies. Active maintenance with recent commits as of 2026-08-11, though still in Alpha status.
License in practice
Dual-licensed under Apache-2.0 OR MIT; users may choose either permissive license at their option, with no restrictions on commercial or private use.
Quickstart
pip install archspec
import archspec.cpu
host = archspec.cpu.host()
print(host.name)
Verify before relying
- Specific CPU models and microarchitectures supported by version 0.2.6
- Performance characteristics when querying large architecture datasets
- Stability guarantees given Alpha development status
Package facts
| License | Apache-2.0 OR MIT (permissive) |
| Python support | supports the current Python release (!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 92 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 348,378/month — #7,342 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: archspec-0.2.6-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
screeninfoDetects and reports the location, dimensions,…
permissive · top 5,000 on PyPI
archinfoProvides architecture-specific metadata and…
permissive · top 5,000 on PyPI
GlancesGlances is a cross-platform system monitoring…
copyleft · top 15,000 on PyPI
extra-platformsDetects and exposes rich metadata about runtime…
permissive · top 15,000 on PyPI
censysA Python wrapper for Censys APIs that lets you…
permissive · top 15,000 on PyPI
mozinfoProvides system information detection for…
copyleft · top 15,000 on PyPI
py-cpuinfoDetects and reports CPU…
permissive · top 1,000 on PyPI
Adafruit-PlatformDetectDetects the chip and board type of single-board…
permissive · top 15,000 on PyPI
impi-rtProvides Intel's standards-based MPI…
unclear · top 15,000 on PyPI