skillfed

archspec

A library to query system architecture

archspec v0.2.6 348.4K downloads/30d#7,342 on PyPI135
Permissive license Apache-2.0 OR MIT Active released

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 archspec

uv

uv add archspec

poetry

poetry add archspec

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: Other/Proprietary LicenseOperating System :: MacOSOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

cpu microarchitecture detectionsystem architecture compatibilitycpu model comparisonarchitecture labelingmicroarchitecture querieshardware compatibility checkingarchitecture metadata
cpu-architecturehardware-detectioncompatibility-checking

More Software Development packages