Groups

All groups

All recognized groups and their properties:

Icon

Symbol

Description

Detection function

Canonical

Member count

🏛️

ALL_ARCHITECTURES

All architectures

is_all_architectures()

24

ALL_CI

All CI systems

is_all_ci()

11

⚙️

ALL_PLATFORMS

All platforms

is_all_platforms()

47

ALL_TRAITS

Any architectures, platforms and CI systems

is_all_traits()

82

📱

ANY_ARM

Any ARM architecture

is_any_arm()

5

🔲

ANY_MIPS

Any MIPS architecture

is_any_mips()

4

☀️

ANY_SPARC

Any SPARC architecture

is_any_sparc()

2

🪟

ANY_WINDOWS

Any Windows

is_any_windows()

1

³²

ARCH_32_BIT

32-bit architectures

is_arch_32_bit()

13

⁶⁴

ARCH_64_BIT

64-bit architectures

is_arch_64_bit()

11

🅱️+

BSD

Any BSD

is_bsd()

6

🅱️

BSD_WITHOUT_MACOS

Any BSD excluding macOS

is_bsd_without_macos()

5

🏢

IBM_MAINFRAME

IBM mainframe

is_ibm_mainframe()

1

🐧

LINUX

Any Linux distribution

is_linux()

34

LINUX_LAYERS

Any Linux compatibility layers

is_linux_layers()

2

🐧+

LINUX_LIKE

Any Linux and compatibility layers

is_linux_like()

36

🐉

LOONGARCH

LoongArch

is_loongarch()

1

OTHER_UNIX

Any other Unix

is_other_unix()

1

POWERPC

PowerPC family

is_powerpc()

3

RISCV

RISC-V family

is_riscv()

2

𝐕

SYSTEM_V

AT&T System Five

is_system_v()

2

UNIX

Any Unix

is_unix()

46

UNIX_LAYERS

Any Unix compatibility layers

is_unix_layers()

1

UNIX_WITHOUT_MACOS

Any Unix excluding macOS

is_unix_without_macos()

45

UNKNOWN

Unknown

is_unknown()

3

🌐

WEBASSEMBLY

WebAssembly

is_webassembly()

2

𝘅

X86

x86 family

is_x86()

4

Hint

Canonical groups are non-overlapping groups that together cover all recognized traits. They are marked with a ⬥ icon in the table above.

Other groups are provided for convenience, but overlap with each other or with canonical groups.

extra_platforms.group API

        classDiagram
  _Identifiable <|-- Group
    

Group a collection of traits. Also referred as families.

class extra_platforms.group.Group(id, name, icon='❓', members=<factory>)[source]

Bases: _Identifiable

A Group identifies a collection of Trait members.

Additionally of the common fields inherited from _Identifiable, each trait provides:

  • members: An iterable of Trait instances that belong to this group.

  • member_ids: A frozenset of member IDs for quick lookup.

  • canonical: A boolean indicating if the group is canonical (non-overlapping).

  • various set-like operations (union, intersection, difference, etc.).

unknown_symbol: ClassVar[str] = 'UNKNOWN'

Groups use ‘UNKNOWN’ instead of ‘UNKNOWN_GROUP’.

current_func_id: ClassVar[str | None] = None

Groups don’t have a current_group() function.

members: Iterable[Trait]

Traits in this group.

Normalized to MappingProxyType[str, Trait] at init, providing O(1) lookup by ID.

property member_ids: frozenset[str]

Set of member IDs that belong to this group.

property canonical: bool

Returns True if the group is canonical (non-overlapping), False otherwise.

A canonical group is one that does not share any members with other canonical groups.

Hint

Canonical groups are denoted with a “⬥” symbol in the documentation and tables.

property short_desc: str

Return a short description with the first letter lowercased.

Overrides the base implementation to produce text suitable for mid-sentence use in docstrings, e.g., “any Linux distribution” instead of “Any Linux distribution”.

items()[source]

Iterate over the traits of the group as key-value pairs.

Return type:

Iterator[tuple[str, Trait]]

isdisjoint(other)[source]

Return True if the group has no members in common with other.

Groups are disjoint if and only if their intersection is an empty set.

other can be an arbitrarily nested Iterable of Group and Trait.

Return type:

bool

fullyintersects(other)[source]

Return True if the group has all members in common with other.

Return type:

bool

issubset(other)[source]

Test whether every member in the group is in other.

Return type:

bool

issuperset(other)[source]

Test whether every member in other is in the group.

Return type:

bool

union(*others)[source]

Return a new Group with members from the group and all others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

intersection(*others)[source]

Return a new Group with members common to the group and all others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

difference(*others)[source]

Return a new Group with members in the group that are not in the others.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

symmetric_difference(other)[source]

Return a new Group with members in either the group or other but not both.

Caution

The new Group will inherits the metadata of the first one. All other groups’ metadata will be ignored.

Return type:

Group

copy(id=None, name=None, icon=None, members=None)[source]

Return a shallow copy of the group.

Fields can be overridden by passing new values as arguments.

Return type:

Group

add(member)[source]

Return a new Group with the specified trait added.

If the trait is already in the group, returns a copy unchanged.

Return type:

Group

Args:

member: A Trait object or trait ID string to add.

Returns:

A new Group instance with the trait added.

Raises:

ValueError: If the trait ID is not recognized.

remove(member)[source]

Return a new Group with the specified trait removed.

Raises KeyError if the trait is not in the group.

Return type:

Group

Args:

member: A Trait object or trait ID string to remove.

Returns:

A new Group instance with the trait removed.

Raises:

KeyError: If the trait is not in the group.

all_group: ClassVar[str] = 'ALL_GROUPS'

The symbol name for the group containing all instances of this type.

data_module_id: ClassVar[str] = 'group_data'

The module name where instances of this type are defined.

discard(member)[source]

Return a new Group with the specified trait removed if present.

Unlike remove(), this does not raise an error if the trait is not found.

Return type:

Group

Args:

member: A Trait object or trait ID string to remove.

Returns:

A new Group instance with the trait removed, or a copy if not present.

doc_page: ClassVar[str] = 'groups.md'

The documentation page filename.

type_id: ClassVar[str] = 'group'

Machine-readable type identifier used to derive module and symbol names.

type_name: ClassVar[str] = 'group'

Human-readable type name for documentation.

id: str

Unique ID of the object.

symbol_id: str

Symbolic identifier.

This is the variable name under which the instance can be accessed at the root of the extra_platforms module.

Mainly useful for documentation generation.

detection_func_id: str

ID of the detection function for this object.

The detection function is expected to be named is_<id>() and located at the root of the extra_platforms module.

name: str

User-friendly name of the object.

pop(member_id=None)[source]

Remove and return a trait from the group.

Return type:

tuple[Trait, Group]

Args:
member_id: Optional trait ID to remove. If not provided, removes an arbitrary

trait (specifically, the first one in iteration order).

Returns:

A tuple of (removed_trait, new_group).

Raises:

KeyError: If member_id is provided but not found in the group. KeyError: If the group is empty.

clear()[source]

Return a new empty Group with the same metadata.

Return type:

Group

Returns:

A new Group instance with no members but same id, name, and icon.

extra_platforms.group_data API

Definitions of ready-to-use groups.

extra_platforms.group_data.ALL_ARCHITECTURES: Group = Group(id='all_architectures', name='All architectures')

All recognized architectures.

Caution

This group does not contain the UNKNOWN_ARCHITECTURE trait.

extra_platforms.group_data.ALL_CI = Group(id='all_ci', name='All CI systems')

All recognized Continuous Integration systems.

Caution

This group does not contain the UNKNOWN_CI trait.

extra_platforms.group_data.ALL_PLATFORMS: Group = Group(id='all_platforms', name='All platforms')

All recognized platforms.

Caution

This group does not contain the UNKNOWN_PLATFORM traits.

extra_platforms.group_data.ALL_TRAITS = Group(id='all_traits', name='Any architectures, platforms and CI systems')

All recognized architectures, platforms and CI systems.

Caution

This group does not contain all UNKNOWN_* traits.

extra_platforms.group_data.ANY_ARM = Group(id='any_arm', name='Any ARM architecture')

All ARM-based architectures.

extra_platforms.group_data.ANY_MIPS = Group(id='any_mips', name='Any MIPS architecture')

All MIPS-based architectures.

extra_platforms.group_data.ANY_SPARC = Group(id='any_sparc', name='Any SPARC architecture')

All SPARC-based architectures.

extra_platforms.group_data.ANY_WINDOWS = Group(id='any_windows', name='Any Windows')

All Windows operating systems.

extra_platforms.group_data.ARCH_32_BIT = Group(id='arch_32_bit', name='32-bit architectures')

All 32-bit architectures.

extra_platforms.group_data.ARCH_64_BIT = Group(id='arch_64_bit', name='64-bit architectures')

All 64-bit architectures.

extra_platforms.group_data.BSD = Group(id='bsd', name='Any BSD')

All BSD platforms.

Note

Are considered of this family (according Wikipedia):

  • 386BSD (FreeBSD, NetBSD, OpenBSD, DragonFly BSD)

  • NeXTSTEP

  • Darwin (macOS, iOS, audioOS, iPadOS, tvOS, watchOS, bridgeOS)

  • SunOS

  • Ultrix

extra_platforms.group_data.BSD_WITHOUT_MACOS = Group(id='bsd_without_macos', name='Any BSD excluding macOS')

All BSD platforms, without macOS.

This is useful to avoid macOS-specific workarounds on BSD platforms.

extra_platforms.group_data.IBM_MAINFRAME = Group(id='ibm_mainframe', name='IBM mainframe')

IBM mainframe architectures.

extra_platforms.group_data.LINUX = Group(id='linux', name='Any Linux distribution')

All distributions based on a Linux kernel.

Note

Are considered of this family (according Wikipedia):

  • Android

  • ChromeOS

  • any other distribution

extra_platforms.group_data.LINUX_LAYERS = Group(id='linux_layers', name='Any Linux compatibility layers')

Interfaces that allows Linux binaries to run on a different host system.

Note

Are considered of this family (according Wikipedia):

  • Windows Subsystem for Linux

extra_platforms.group_data.LINUX_LIKE = Group(id='linux_like', name='Any Linux and compatibility layers')

Sum of all Linux distributions and Linux compatibility layers.

extra_platforms.group_data.LOONGARCH = Group(id='loongarch', name='LoongArch')

LoongArch architecture.

extra_platforms.group_data.OTHER_UNIX = Group(id='other_unix', name='Any other Unix')

All other Unix platforms.

Note

Are considered of this family (according Wikipedia):

  • Coherent

  • GNU/Hurd

  • HarmonyOS

  • LiteOS

  • LynxOS

  • Minix

  • MOS

  • OSF/1

  • QNX

  • BlackBerry 10

  • Research Unix

  • SerenityOS

extra_platforms.group_data.POWERPC = Group(id='powerpc', name='PowerPC family')

All PowerPC-based architectures.

extra_platforms.group_data.RISCV = Group(id='riscv', name='RISC-V family')

All RISC-V-based architectures.

extra_platforms.group_data.SYSTEM_V = Group(id='system_v', name='AT&T System Five')

All Unix platforms derived from AT&T System Five.

Note

Are considered of this family (according Wikipedia):

  • A/UX

  • AIX

  • HP-UX

  • IRIX

  • OpenServer

  • Solaris

  • OpenSolaris

  • Illumos

  • Tru64

  • UNIX

  • UnixWare

extra_platforms.group_data.UNIX = Group(id='unix', name='Any Unix')

All Unix-like operating systems and compatibility layers.

extra_platforms.group_data.UNIX_LAYERS = Group(id='unix_layers', name='Any Unix compatibility layers')

Interfaces that allows Unix binaries to run on a different host system.

Note

Are considered of this family (according Wikipedia):

  • Cygwin

  • Darling

  • Eunice

  • GNV

  • Interix

  • MachTen

  • Microsoft POSIX subsystem

  • MKS Toolkit

  • PASE

  • P.I.P.S.

  • PWS/VSE-AF

  • UNIX System Services

  • UserLAnd Technologies

  • Windows Services for UNIX

extra_platforms.group_data.UNIX_WITHOUT_MACOS = Group(id='unix_without_macos', name='Any Unix excluding macOS')

All Unix platforms, without macOS.

This is useful to avoid macOS-specific workarounds on Unix platforms.

extra_platforms.group_data.UNKNOWN = Group(id='unknown', name='Unknown')

Unknown or unrecognized traits.

extra_platforms.group_data.WEBASSEMBLY = Group(id='webassembly', name='WebAssembly')

WebAssembly architectures.

extra_platforms.group_data.X86 = Group(id='x86', name='x86 family')

All x86-based architectures (Intel-compatible).