Extra PlatformsΒΆ
What is Extra Platforms?ΒΆ
Inventory of all known architectures, platforms and CI systems
Detect the current architecture platform, at the distribution level
Platform metadata (version, codename, etc.)
Group platforms and architectures into families
Manage collection of platforms and groups
Associate each platform and group to an emoji symbol
Conditional markers decorators for
pytest:@skip_<id>/@unless_<id>for each platform and group (@skip_android,@skip_any_windows,@skip_github_ci, β¦)
Quick startΒΆ
If you want to play with this library without contaminating your system, you can use uv:
$ uvx --with extra-platforms python
>>> import extra_platforms
>>> extra_platforms.__version__
'6.0.0'
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': 'darwin',
'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'),
'unknown_linux': Platform(id='unknown_linux', name='Unknown Linux'),
'xenserver': Platform(id='xenserver', name='XenServer'),
})
>>> LINUX.member_ids
frozenset({'centos', 'mageia', 'unknown_linux', 'ultramarine', 'tuxedo', 'arch', 'buildroot', 'android', 'exherbo', '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
Unknown 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'),
})
ArchitecturesΒΆ
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)
)βοΈ ANY_SPARC(
(βοΈ sparc)
(βοΈ sparc64)
)π§ ANY_MIPS(
(π§ mips)
(π§ mips64)
(π§ mips64el)
(π§ mipsel)
)π± ANY_ARM(
(π aarch64)
(π± arm)
(π± armv6l)
(π± armv7l)
(π± armv8l)
(β unknown_architecture)
PlatformsΒΆ
All recognized platforms and how theyβre grouped:
---
config:
mindmap:
padding: 5
---
mindmap
((βοΈ all_platforms))
)β UNIX_LAYERS(
(ΟΎ cygwin)
)β
€ SYSTEM_V(
(βΏ aix)
(π solaris)
)β OTHER_UNIX(
(π hurd)
)β LINUX_LAYERS(
(β wsl1)
(β wsl2)
)π§ LINUX(
(π§ altlinux)
(β€» amzn)
(π€ android)
(ποΈ arch)
(βοΈ buildroot)
(β¬ cachyos)
(π centos)
(κ© cloudlinux)
(π debian)
(π½ exherbo)
(π© fedora)
(ποΈ gentoo)
(π guix)
(π€Ή ibm_powerkvm)
(π€Ή kvmibm)
(πΏ linuxmint)
(β₯ mageia)
(π« mandriva)
(ο nobara)
(π¦ opensuse)
(𦴠oracle)
(β₯ parallels)
(π pidora)
(π raspbian)
(π© rhel)
(β°οΈ rocky)
(βοΈ scientific)
(π¬ slackware)
(π¦ sles)
(β» tumbleweed)
(π€΅ tuxedo)
(π― ubuntu)
(π ultramarine)
(π§ unknown_linux)
(β xenserver)
)π
±οΈ+ BSD(
(π freebsd)
(π macos)
(π midnightbsd)
(π© netbsd)
(π‘ openbsd)
(βοΈ sunos)
)πͺ ANY_WINDOWS(
(πͺ windows)
Tip
More groups exist beyond those shown in the diagram, and more utilities are available for each platform. See the platform documentation for details.
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)
(β² unknown_ci)
Used inΒΆ
Check these projects to get real-life examples of extra-platforms usage:
Meta Package Manager - A unifying CLI for multiple package managers.
Mail Deduplicate - Deduplicate emails in mail files and folders.
Click Extra - Drop-in replacement for Click to make user-friendly and colorful CLI.
Feel free to send a PR to add your project in this list if you are relying on Extra Platforms in any way.
DevelopmentΒΆ
Development guidelines are the same as parent project Click Extra, from which extra-platforms originated.