{"id":23695,"library":"extra-platforms","title":"extra-platforms","description":"Detect architectures, platforms, shells, terminals, CI systems and agents, grouped by family. Current version: 12.0.3, requires Python >=3.10. Active development with frequent releases.","status":"active","version":"12.0.3","language":"python","source_language":"en","source_url":"https://github.com/kdeldycke/extra-platforms","tags":["platform-detection","ci-detection","shell-detection","architecture-detection"],"install":[{"cmd":"pip install extra-platforms","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"All detection functions are top-level; submodule imports are incorrect.","wrong":"from extra_platforms.platform import is_linux","symbol":"is_linux","correct":"from extra_platforms import is_linux"},{"note":"Constant for listing all known traits.","symbol":"ALL_TRAITS","correct":"from extra_platforms import ALL_TRAITS"},{"note":"Direct import preferred for clarity and typing.","wrong":"import extra_platforms; extra_platforms.is_macos()","symbol":"is_macos","correct":"from extra_platforms import is_macos"}],"quickstart":{"code":"from extra_platforms import is_linux, is_macos, is_windows, is_ci, ALL_TRAITS\n\nprint('Linux:', is_linux())\nprint('macOS:', is_macos())\nprint('Windows:', is_windows())\nprint('CI:', is_ci())\nprint('All traits:', [t for t in ALL_TRAITS if getattr(__import__('extra_platforms'), t)()])","lang":"python","description":"Basic usage: detect platform traits and list all active ones."},"warnings":[{"fix":"Update checks for shell traits; use new `is_sh()` if needed.","message":"In v12.0.0, shell detection was overhauled; the `is_sh()` function was added and symlink resolution changed. Code relying on shell detection may need updates.","severity":"breaking","affected_versions":"<12.0.0"},{"fix":"Use `from extra_platforms import function_name`.","message":"Importing from submodules like `extra_platforms.platform` is deprecated in favor of top-level imports.","severity":"deprecated","affected_versions":">=11.0.0"},{"fix":"Wrap calls in try/except or check `is_shell()` first.","message":"Detection functions return booleans but may raise exceptions if called in very restricted environments (e.g., BusyBox without any shell). Tests skip these scenarios, but production code should handle gracefully.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install extra-platforms`","cause":"Package not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'extra_platforms'"},{"fix":"Use `from extra_platforms import is_linux`","cause":"Importing from subpackage instead of top-level, or using old version.","error":"AttributeError: module 'extra_platforms' has no attribute 'is_linux'"},{"fix":"Detection functions are plain functions, not methods. Use `from extra_platforms import is_linux` and call `is_linux()` directly.","cause":"Trying to import classes or instantiate incorrectly.","error":"TypeError: is_linux() missing 1 required positional argument: 'self'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}