Live
Black Hat USADark ReadingBlack Hat AsiaAI BusinessI'm 9 Days Old, Built 40+ Products, and Made $0 — The Brutal Truth About Being an Autonomous AI AgentDev.to AII Put an LLM Inside the Linux Kernel Scheduler. Here's What Happened.Dev.to AIBig Tech firms are accelerating AI investments and integration, while regulators and companies focus on safety and responsible adoption.Dev.to AISelf-Improving Python Scripts with LLMs: My JourneyDev.to AImorningbrew.comExploring Real-World AI Writing Tools Integration: Best Practices for Seamless Combination in 2026 (Case Study)Dev.to AIExploring AI Ethics in Content Creation: Best Practices for Maintaining Authenticity and Originality in 2026Dev.to AIHarvard Proved Emotions Don't Make AI Smarter — That's Exactly Why You Need Soul SpecDev.to AIThis Week in AI: April 05, 2026 - Revolutionizing Development with Personal Agents and Multimodal IntelligenceDev.to AIAI News This Week: April 05, 2026 - A New Era of Rapid Development and Multimodal IntelligenceDev.to AIUntitledDev.to AI🚀 Build a Professional Image Converter GUI in Python (Step-by-Step)DEV CommunityBlack Hat USADark ReadingBlack Hat AsiaAI BusinessI'm 9 Days Old, Built 40+ Products, and Made $0 — The Brutal Truth About Being an Autonomous AI AgentDev.to AII Put an LLM Inside the Linux Kernel Scheduler. Here's What Happened.Dev.to AIBig Tech firms are accelerating AI investments and integration, while regulators and companies focus on safety and responsible adoption.Dev.to AISelf-Improving Python Scripts with LLMs: My JourneyDev.to AImorningbrew.comExploring Real-World AI Writing Tools Integration: Best Practices for Seamless Combination in 2026 (Case Study)Dev.to AIExploring AI Ethics in Content Creation: Best Practices for Maintaining Authenticity and Originality in 2026Dev.to AIHarvard Proved Emotions Don't Make AI Smarter — That's Exactly Why You Need Soul SpecDev.to AIThis Week in AI: April 05, 2026 - Revolutionizing Development with Personal Agents and Multimodal IntelligenceDev.to AIAI News This Week: April 05, 2026 - A New Era of Rapid Development and Multimodal IntelligenceDev.to AIUntitledDev.to AI🚀 Build a Professional Image Converter GUI in Python (Step-by-Step)DEV Community
AI NEWS HUBbyEIGENVECTOREigenvector

Show HN: Extra-Platforms, Python library to detect OS, arch, shell, CI, AI

Hacker News AI Topby kdeldyckeApril 2, 20266 min read1 views
Source Quiz

I built Extra Platforms over the past 5 years because I kept writing the same detection boilerplate over and over. And also because Python's original platform.linux_distribution() function has been removed in Python 3.8. Its replacement, Distro, only covers Linux. It detects six traits (CPU architecture, OS/distribution, shell, terminal, CI, agents), which are grouped into families (BSD, LINUX, UNIX, ...) for convenience. You can try the library without installing anything: $ uvx --with extra-platforms python >>> from extra_platforms import current_platform, BSD, is_linux >>> current_platform() Platform(id='macos', name='macOS') >>> current_platform() in BSD True >>> is_linux() False It also ships Pytest decorators (@skip_linux, @unless_macos) for platform-conditional tests. The library ha

What is Extra Platforms?

Extra Platforms detects the runtime architecture, operating system (including Linux distribution), shell, terminal, CI environment & AI coding agents, and exposes rich, cacheable metadata (version, codename, icon, canonical URL). It also groups them into reusable families.

  • Accurate detection of architecture, OS/distribution, shell, terminal, and CI systems using lightweight, cacheable heuristics.

  • Rich metadata for platforms: version, codename, icon, canonical URL, and "like" relationships.

  • Grouping and API primitives: predefined families, is_() predicates, current_() accessors, and Group membership helpers.

  • Testing helpers: Pytest decorators and markers such as @skip_ and @unless_ for concise platform-aware tests.

  • Extensible and CI-friendly: designed to be lightweight, easy to extend, and suitable for CI-aware workflows.

  • Built-in Linux distribution detection via /etc/os-release, with no external dependencies.

Quick start

Quickly inspect your current environment without installing anything, thanks to uvx:

$ uvx extra-platforms extra-platforms 9.0.1

── Architecture ── 📱 ARM64 (AArch64) ──[AARCH64]──────────── id: aarch64 (...)

── Platform ── 🍎 macOS ──[MACOS]──────────────────────────── id: macos (...)

── Shell ── ℤ Zsh ──[ZSH]─────────────────────────────────── id: zsh (...)

── Terminal ── 🍏 Apple Terminal ──[APPLE_TERMINAL]────────── id: apple_terminal (...)

── CI ── ❓ Unknown CI ──[UNKNOWN_CI]──────────────────────── (...)

── Agent ── ✴️ Claude Code ──[CLAUDE_CODE]────────────────── (...)`

The same output is available via python -m extra_platforms.

Or if you want to explore usage of the library in a Python REPL:

$ uvx --with extra-platforms python >>> import extra_platforms

extra_platforms.version '9.0.1'`

Examples

Get the current platform, from which you can access lots of metadata:

>>> from extra_platforms import current_platform

my_os = current_platform() my_os Platform(id='macos', name='macOS') my_os.id 'macos' my_os.name 'macOS' my_os.icon '🍎' my_os.info() { 'id': 'macos', 'name': 'macOS', 'icon': '🍎', 'url': 'https://apple.com/macos/', 'current': True, 'distro_id': None, 'version': '26.2', 'version_parts': {'major': '26', 'minor': '2', 'build_number': None}, 'like': None, 'codename': 'Tahoe', }`

Check if a platform is a specific system:

>>> from extra_platforms import is_gentoo

is_gentoo() False`

Use groups to check if the current platform is part of a specific family:

>>> from extra_platforms import current_platform, BSD, UNIX, LINUX

current_platform() Platform(id='macos', name='macOS') current_platform() in BSD True current_platform() in UNIX True current_platform() in LINUX False`

Or directly use the detection functions returning a boolean that is associated with each group:

>>> from extra_platforms import is_bsd, is_unix, is_linux

is_bsd() True is_unix() True is_linux() False`

List all platforms of a family:

>>> from extra_platforms import LINUX

LINUX.members mappingproxy({ 'altlinux': Platform(id='altlinux', name='ALT Linux'), 'amzn': Platform(id='amzn', name='Amazon Linux'), 'android': Platform(id='android', name='Android'), 'arch': Platform(id='arch', name='Arch Linux'), 'buildroot': Platform(id='buildroot', name='Buildroot'), 'cachyos': Platform(id='cachyos', name='CachyOS'), 'centos': Platform(id='centos', name='CentOS'), 'cloudlinux': Platform(id='cloudlinux', name='CloudLinux OS'), 'debian': Platform(id='debian', name='Debian'), 'exherbo': Platform(id='exherbo', name='Exherbo Linux'), 'fedora': Platform(id='fedora', name='Fedora'), 'gentoo': Platform(id='gentoo', name='Gentoo Linux'), 'guix': Platform(id='guix', name='Guix System'), 'ibm_powerkvm': Platform(id='ibm_powerkvm', name='IBM PowerKVM'), 'kvmibm': Platform(id='kvmibm', name='KVM for IBM z Systems'), 'linuxmint': Platform(id='linuxmint', name='Linux Mint'), 'mageia': Platform(id='mageia', name='Mageia'), 'mandriva': Platform(id='mandriva', name='Mandriva Linux'), 'nobara': Platform(id='nobara', name='Nobara'), 'opensuse': Platform(id='opensuse', name='openSUSE'), 'oracle': Platform(id='oracle', name='Oracle Linux'), 'parallels': Platform(id='parallels', name='Parallels'), 'pidora': Platform(id='pidora', name='Pidora'), 'raspbian': Platform(id='raspbian', name='Raspbian'), 'rhel': Platform(id='rhel', name='RedHat Enterprise Linux'), 'rocky': Platform(id='rocky', name='Rocky Linux'), 'scientific': Platform(id='scientific', name='Scientific Linux'), 'slackware': Platform(id='slackware', name='Slackware'), 'sles': Platform(id='sles', name='SUSE Linux Enterprise Server'), 'tumbleweed': Platform(id='tumbleweed', name='openSUSE Tumbleweed'), 'tuxedo': Platform(id='tuxedo', name='Tuxedo OS'), 'ubuntu': Platform(id='ubuntu', name='Ubuntu'), 'ultramarine': Platform(id='ultramarine', name='Ultramarine'), 'void': Platform(id='void', name='Void Linux'), 'generic_linux': Platform(id='generic_linux', name='Generic Linux'), 'xenserver': Platform(id='xenserver', name='XenServer'), }) LINUX.member_ids frozenset({'centos', 'mageia', 'generic_linux', 'ultramarine', 'tuxedo', 'arch', 'buildroot', 'android', 'exherbo', 'void', 'mandriva', 'fedora', 'slackware', 'parallels', 'xenserver', 'kvmibm', 'nobara', 'amzn', 'guix', 'debian', 'oracle', 'cachyos', 'altlinux', 'rhel', 'ibm_powerkvm', 'rocky', 'scientific', 'sles', 'linuxmint', 'tumbleweed', 'ubuntu', 'pidora', 'cloudlinux', 'gentoo', 'raspbian', 'opensuse'}) print("\n".join([p.name for p in LINUX])) ALT Linux Amazon Linux Android Arch Linux Buildroot CachyOS CentOS CloudLinux OS Debian Exherbo Linux Fedora Gentoo Linux Guix System IBM PowerKVM KVM for IBM z Systems Linux Mint Mageia Mandriva Linux Nobara openSUSE Oracle Linux Parallels Pidora Raspbian RedHat Enterprise Linux Rocky Linux Scientific Linux Slackware SUSE Linux Enterprise Server openSUSE Tumbleweed Tuxedo OS Ubuntu Ultramarine Void Linux Generic Linux XenServer`

Reduce a disparate collection of groups and platforms into a minimal descriptive set, by grouping all platforms into families:

>>> from extra_platforms import AIX, MACOS, SOLARIS, reduce

reduce([AIX, MACOS]) frozenset({ Platform(id='macos', name='macOS'), Platform(id='aix', name='IBM AIX'), }) reduce([AIX, MACOS, SOLARIS]) frozenset({ Group(id='system_v', name='AT&T System Five'), Platform(id='macos', name='macOS'), })`

All recognized architectures and how they're grouped:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((🏛️ ALL_ARCHITECTURES)) )𝘅 X86( (𝗶 I386) (𝗶 I586) (𝗶 I686) (🖥️ X86_64) )🌐 WEBASSEMBLY( (🌐 WASM32) (🌐 WASM64) )Ⅴ RISCV( (Ⅴ RISCV32) (Ⅴ RISCV64) )⚡ POWERPC( (⚡ PPC) (⚡ PPC64) (⚡ PPC64LE) )🐉 LOONGARCH( (🐉 LOONGARCH64) )🏢 IBM_MAINFRAME( (🏢 S390X) )☀️ ALL_SPARC( (☀️ SPARC) (☀️ SPARC64) )🔲 ALL_MIPS( (🔲 MIPS) (🔲 MIPS64) (🔲 MIPS64EL) (🔲 MIPSEL) )📱 ALL_ARM( (📱 AARCH64) (📱 ARM) (📱 ARMV5TEL) (📱 ARMV6L) (📱 ARMV7L) (📱 ARMV8L)`

Loading

Platforms

All recognized platforms and how they're grouped:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((⚙️ ALL_PLATFORMS)) )≛ UNIX_LAYERS( (Ͼ CYGWIN) )𝐕 SYSTEM_V( (➿ AIX) (🔥 ILLUMOS) (🌞 SOLARIS) )🅟 OTHER_POSIX( (🍂 HAIKU) (🦬 HURD) )≚ LINUX_LAYERS( (⊞ WSL1) (⊞ WSL2) )🐧 LINUX( (🏔️ ALPINE) (Δ ALTLINUX) (⤻ AMZN) (🤖 ANDROID) (🎗️ ARCH) (⛑️ BUILDROOT) (⌬ CACHYOS) (💠 CENTOS) (꩜ CLOUDLINUX) (🌀 DEBIAN) (🐽 EXHERBO) (🎩 FEDORA) (🥚 GENERIC_LINUX) (🗜️ GENTOO) (🐃 GUIX) (🤹 IBM_POWERKVM) (🔱 KALI) (🤹 KVMIBM) (🌿 LINUXMINT) (⍥ MAGEIA) (💫 MANDRIVA) (▲ MANJARO) ( NOBARA) (🦎 OPENSUSE) (📶 OPENWRT) (🦴 ORACLE) (∥ PARALLELS) (🍓 PIDORA) (🍓 RASPBIAN) (🎩 RHEL) (⛰️ ROCKY) (⚛️ SCIENTIFIC) (🚬 SLACKWARE) (🦎 SLES) (↻ TUMBLEWEED) (🤵 TUXEDO) (🎯 UBUNTU) (🌊 ULTRAMARINE) (∅ VOID) (Ⓧ XENSERVER) )Ⓑ BSD( (🪰 DRAGONFLY_BSD) (😈 FREEBSD) (🍎 MACOS) (🌘 MIDNIGHTBSD) (🚩 NETBSD) (🐡 OPENBSD) (🌅 SUNOS) )🪟 ALL_WINDOWS( (🪟 WINDOWS)`

Loading

Tip

More groups exist beyond those shown in the diagram, and more utilities are available for each platform. See the platform documentation for details.

Shells

All recognized shells:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((🐚 ALL_SHELLS)) )⌨️ WINDOWS_SHELLS( (▶ CMD) (🔷 POWERSHELL) )◇ OTHER_SHELLS( (🐟 FISH) (𝜈 NUSHELL) (🐍 XONSH) )🅲 C_SHELLS( (𝐂 CSH) (𝐓 TCSH) )💲 BOURNE_SHELLS( (🪶 ASH) (# BASH) (💨 DASH) (𝐊 KSH) (ℤ ZSH)`

Loading

Terminals

All recognized terminals:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((💻 ALL_TERMINALS)) )⬢ WEB_TERMINALS( (⬡ HYPER) (🐈 TABBY) (🔵 VSCODE_TERMINAL) )▦ NATIVE_TERMINALS( (🍏 APPLE_TERMINAL) (𝐆 GNOME_TERMINAL) (⬛ ITERM2) (💎 KONSOLE) (🔀 TILIX) (⊡ WINDOWS_TERMINAL) (𝐗 XTERM) )⧉ MULTIPLEXERS( (📺 GNU_SCREEN) (📟 TMUX) (🪵 ZELLIJ) )🎮 GPU_TERMINALS( (🔳 ALACRITTY) (◰ CONTOUR) (🦶 FOOT) (👻 GHOSTTY) (🐱 KITTY) (🏞️ RIO) (🔡 WEZTERM)`

Loading

CI systems

All recognized CI systems:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((♺ ALL_CI)) (═ AZURE_PIPELINES) (⟲ BAMBOO) (🪁 BUILDKITE) (⪾ CIRCLE_CI) (≋ CIRRUS_CI) (ᚙ CODEBUILD) (🐙 GITHUB_CI) (🦊 GITLAB_CI) (⥁ HEROKU_CI) (🏙️ TEAMCITY) (👷 TRAVIS_CI)`

Loading

Agents

All recognized AI coding agents:

--- config: {"mindmap": {"padding": 5}} ---

mindmap ((🧠 ALL_AGENTS)) (✴️ CLAUDE_CODE) (👾 CLINE) (➤ CURSOR)`

Loading

Used in

Check these projects to get real-life examples of extra-platforms usage:

Feel free to send a PR to add your project in this list if you are relying on Extra Platforms in any way.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

More about

platformagent

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Show HN: Ex…platformagentHacker News…

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 235 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Products