Distro - OS Platform Information API

1.9.0 · active · verified Sat Mar 28

Distro is a Python library that provides information about the operating system distribution it runs on, such as a reliable machine-readable ID and version information. It serves as a recommended replacement for Python's original platform.linux_distribution function, which was removed in Python 3.8. The current version is 1.9.0, released on October 5, 2023. The library is actively maintained with a stable release cadence, with the latest release being v1.9.0.

Warnings

Install

Imports

Quickstart

A simple script to print the distribution ID, version, and name using the Distro library.

import distro
print(distro.id())
print(distro.version())
print(distro.name())

view raw JSON →