Back to Explore

python-distro/distro

GitHub
1 watchersOpen source

Last release: 2024-01-14

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

  • Maintenance status: The repo shows an upstream push as recently as 2025-11-14, which suggests ongoing maintenance, even though the most recently listed tagged update (v1.9.0) is from 2024-01-14.
  • Update cadence: Tagged updates have been irregular (for example, v1.7.0 in 2022-02, v1.8.0 in 2022-10, v1.9.0 in 2024-01), and the gap between the latest known tag (2024-01) and today (2026-06) is substantial, implying development activity may not always result in tagged updates.

AI summary generated 2026-06-09

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.9.0

    2024-01-14

    Release 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.

    Features
  • v1.8.0

    2022-10-10

    v1.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.

    BreakingFeatures
  • v1.7.0

    2022-02-15

    Release 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).

    BreakingFeatures
  • v1.6.0

    2021-07-30

    Release 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.

    BreakingFeatures
  • v1.5.0

    2020-03-31

    v1.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.

    Features
  • v1.4.0

    2019-02-04

    Release 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

    2018-05-16

    v1.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.

    Features
  • v1.2.0

    2017-12-24

    v1.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.

    Features
  • v1.1.0

    2017-11-28

    v1.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.

    BreakingFeatures
  • v1.0.4

    2017-04-02

    Release 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.