Distro is a Python library that provides OS distribution information, such as a reliable machine readable ID, version, and codename. It is a recommended replacement for Python’s removed platform.linux_distribution(), and it can also be used via a command line interface. It supports Linux and BSD based systems, using data sources like /etc/os-release and related release files.
Project status
- The project appears actively maintained, with an upstream GitHub push noted on 2025-11-14, though the most recent tagged update in the provided history is v1.9.0 (2024-01-14).
- The apparent update cadence is low, with large gaps between tagged updates (for example, v1.8.0 in 2022-10, v1.9.0 in 2024-01), so changes may land more often as non-tag commits.
AI summary generated 2 weeks ago
Recent updates
v1.9.0
1/14/2024Release v1.9.0 primarily refactors `distro.info()` to use a more precise `InfoDict` typed return and adds CI/test coverage for newer environments. The code diff also shows additional OS recognition behavior that is not called out in the release notes.
Featuresv1.8.0
10/10/2022v1.8.0 refactors distro detection logic and adds official support for additional distributions (Buildroot and Guix), plus improved Debian-like version detection via /etc/debian_version. It also modernizes the packaging and CI setup by switching from setup.py to PEP 517 build tooling. The release notes cover most user-facing distro-detection additions, but the code diff shows at least one potential API compatibility risk.
BreakingFeaturesv1.7.0
2/15/2022Release v1.7.0 modernizes the distro package for Python 3 (dropping older EOL versions), adds support for Rocky Linux and AIX, and includes a set of bug fixes. It also restructures the project into a src-layout package and adds typing support (PEP-561).
BreakingFeaturesv1.6.0
7/30/2021Release v1.6.0 focuses on API improvements to the distro library, including deprecations, added typing and version metadata, and enhanced OS release detection (notably arbitrary rootfs and /usr/lib/os-release fallback). It also adds and updates CI and documentation infrastructure as part of the repository move to python-distro/distro.
BreakingFeaturesv1.5.0
3/31/2020v1.5.0 updates the distro detection logic with multiple parsing fixes (RHEL 6 ComputeNode, Oracle 4/5 lsb_release IDs, and handling of Plesk release data) and expands CI coverage to newer Python versions. It also introduces a central _to_str() helper to standardize string/bytes decoding behavior, and adds MidnightBSD support plus tests.
Featuresv1.4.0
2/4/2019Release v1.4.0 focuses on OS release parsing improvements, including using VERSION_CODENAME from os-release instead of deriving codename from VERSION. It also fixes uname_info() and improves CloudLinux and Oracle ID/codename detection, plus updates packaging/documentation to use Markdown for the long description.
v1.3.0
5/16/2018v1.3.0 adds support for OpenBSD, FreeBSD, and NetBSD, along with corresponding documentation and additional tests. The code changes also expand the library’s “Linux distribution” framing toward a more general “OS distribution” approach, including adding BSD identifiers and using BSD `uname` output as an additional data source.
Featuresv1.2.0
12/24/2017v1.2.0 focuses on speeding up usage by lazily loading distribution parsers and improving subprocess output decoding. It also changes import behavior on non-Linux platforms and adjusts CI configuration for flake8 testing.
Featuresv1.1.0
11/28/2017v1.1.0 primarily drops official support for Python 2.6 and adjusts packaging and test resources. It also expands distro detection test coverage for MandrivaLinux and CloudLinux 5, 6, and 7, and updates MANIFEST packaging rules.
BreakingFeaturesv1.0.4
4/2/2017Release v1.0.4 primarily addresses a failure mode where the library could not read from `/etc/` but still needed to detect distribution `*-release` information. The code now falls back to a hardcoded list of common release filenames when `os.listdir(/etc)` raises an error.