Distro
lastmod 2026-11-10created 2025-04-232 edits
distro는 실행 중인 운영체제의 배포판 정보를 알려주는 Python 패키지이다. 표준 라이브러리에서 제거된 platform.linux_distribution 을 대체하며, /etc/os-release 와 lsb_release 등을 읽어 배포판 이름, 버전, 코드명을 돌려준다. 명령줄 도구로도 실행할 수 있다.
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'