mozinfo is a Python library designed to retrieve system information, primarily for use within Mozilla's testing infrastructure. It acts as a bridge to normalize diverse operating system and architecture details into a consistent set of values, such as 'os', 'version', 'bits', and 'processor'. The current version is 1.2.3, and it is actively maintained as part of the broader Mozilla ecosystem.
pip install mozinfoVerified import paths — ran on the pinned version, not inferred.
The quickstart demonstrates how to import the `mozinfo` module and access its primary system information attributes directly. It also shows how to retrieve all available information as a dictionary via `mozinfo.info`.
Explicitly check `if mozinfo.os is mozinfo.unknown:` or `if mozinfo.os == 'UNKNOWN':` instead of `if not mozinfo.os:` if differentiating between `None` and `UNKNOWN` is important.
Ensure the test or script is run in a properly configured Mozilla build environment (`objdir`) if specific build-time information is expected. Alternatively, handle 'UNKNOWN' values gracefully in your code.
Refer to the documentation for available attributes (e.g., `os`, `version`, `bits`, `processor`). If you want to see all available keys, use `mozinfo.info.keys()`.
Understand that `mozinfo` provides a 'Mozilla-centric' view of system info. If you require general system information outside of a Mozilla build context, consider using standard Python modules like `platform` or `os` directly.
No dependency data recorded yet.