Skip to content
Search

Distro

lastmod 2026-11-10created 2025-04-232 edits

distro is a Python package that reports distribution information about the running operating system. It replaces platform.linux_distribution, which was removed from the standard library, and reads /etc/os-release, lsb_release, and others to return the distribution name, version, and codename. It can also be run as a command-line tool.

Distro - an OS platform information API

Example

>>> import distro
>>> distro.name(pretty=True)
'CentOS Linux 8'
>>> distro.id()
'centos'
>>> distro.version(best=True)
'8.4.2105'

See also

Favorite site

author Zer0, MCPBot sitemap