All Projects → nir0s → Distro

nir0s / Distro

Licence: apache-2.0
A much more elaborate, renewed alternative implementation for Python's platform.linux_distribution()

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Distro

Calinix-Arch
CalinixOS Linux Distribution ISO Profiles
Stars: ✭ 42 (-73.42%)
Mutual labels:  distribution, linux-distribution
Ataraxia
Simple and lightweight source-based multi-platform Linux distribution with musl libc.
Stars: ✭ 226 (+43.04%)
Mutual labels:  distribution, linux-distribution
Mac Linux Usb Loader
Boot Linux on your Mac, easily
Stars: ✭ 854 (+440.51%)
Mutual labels:  linux-distribution
Znx
Operating system manager.
Stars: ✭ 127 (-19.62%)
Mutual labels:  linux-distribution
Chromium os Raspberry pi
Build your Chromium OS for Raspberry Pi 3B/3B+/4B and Pi400
Stars: ✭ 1,156 (+631.65%)
Mutual labels:  linux-distribution
Awesome Unix
All the UNIX and UNIX-Like: Linux, BSD, macOS, Illumos, 9front, and more.
Stars: ✭ 973 (+515.82%)
Mutual labels:  linux-distribution
Jingos
JingOS - The World’s First Linux-based OS design for Tablets
Stars: ✭ 101 (-36.08%)
Mutual labels:  linux-distribution
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+466.46%)
Mutual labels:  distribution
Unstable Packages
A place for untested & problematic packages.
Stars: ✭ 149 (-5.7%)
Mutual labels:  linux-distribution
Distribution Is All You Need
The basic distribution probability Tutorial for Deep Learning Researchers
Stars: ✭ 1,109 (+601.9%)
Mutual labels:  distribution
Cylon
A CLI TUI menu driven bash shell script supporting updates, maintenance, backups and system checks for an Arch based Linux distro
Stars: ✭ 121 (-23.42%)
Mutual labels:  linux-distribution
Ggeconodist
📉 Create Diminutive Distribution Charts
Stars: ✭ 53 (-66.46%)
Mutual labels:  distribution
Pyscaffold
🛠 Python project template generator with batteries included
Stars: ✭ 1,022 (+546.84%)
Mutual labels:  distribution
Fitter
Fit data to many distributions
Stars: ✭ 118 (-25.32%)
Mutual labels:  distribution
Kiss Old
Kiss Linux Distribution
Stars: ✭ 20 (-87.34%)
Mutual labels:  linux-distribution
Open social
Open Social install profile Drupal 8
Stars: ✭ 128 (-18.99%)
Mutual labels:  distribution
Snacklinux
Linux distribution for lazy people
Stars: ✭ 9 (-94.3%)
Mutual labels:  linux-distribution
Erpnext
Free and Open Source Enterprise Resource Planning (ERP)
Stars: ✭ 10,220 (+6368.35%)
Mutual labels:  distribution
Typo3 Cms Speciality Distribution
Bootstrap Package for TYPO3 CMS
Stars: ✭ 83 (-47.47%)
Mutual labels:  distribution
Game Packages
Games for Termux
Stars: ✭ 155 (-1.9%)
Mutual labels:  linux-distribution

Distro - an OS platform information API

Build Status Build status PyPI version Supported Python Versions Requirements Status Code Coverage Code Quality Is Wheel Latest Github Release Join the chat at https://gitter.im/nir0s/distro

distro provides information about the OS distribution it runs on, such as a reliable machine-readable ID, or version information.

It is the recommended replacement for Python's original platform.linux_distribution function (which will be removed in Python 3.8). It also provides much more functionality which isn't necessarily Python bound, like a command-line interface.

Distro currently supports Linux and BSD based systems but Windows and OS X support is also planned.

For Python 2.6 support, see https://github.com/nir0s/distro/tree/python2.6-support

Installation

Installation of the latest released version from PyPI:

pip install distro

Installation of the latest development version:

pip install https://github.com/nir0s/distro/archive/master.tar.gz

Usage

$ distro
Name: Antergos Linux
Version: 2015.10 (ISO-Rolling)
Codename: ISO-Rolling

$ distro -j
{
    "codename": "ISO-Rolling",
    "id": "antergos",
    "like": "arch",
    "version": "16.9",
    "version_parts": {
        "build_number": "",
        "major": "16",
        "minor": "9"
    }
}


$ python
>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '7.1.1503', 'Core')

Documentation

On top of the aforementioned API, several more functions are available. For a complete description of the API, see the latest API documentation.

Background

An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.8 will remove it altogether. Its predecessor function platform.dist was already deprecated since Python 2.6 and will also be removed in Python 3.8. Still, there are many cases in which access to that information is needed. See Python issue 1322 for more information.

The distro package implements a robust and inclusive way of retrieving the information about a distribution based on new standards and old methods, namely from these data sources (from high to low precedence):

  • The os-release file /etc/os-release, if present.
  • The output of the lsb_release command, if available.
  • The distro release file (/etc/*(-|_)(release|version)), if present.
  • The uname command for BSD based distrubtions.

Python and Distribution Support

distro is supported and tested on Python 2.7, 3.4+ and PyPy and on any distribution that provides one or more of the data sources covered.

This package is tested with test data that mimics the exact behavior of the data sources of a number of Linux distributions.

Testing

git clone [email protected]:nir0s/distro.git
cd distro
pip install tox
tox

Contributions

Pull requests are always welcome to deal with specific distributions or just for general merriment.

See CONTRIBUTIONS for contribution info.

Reference implementations for supporting additional distributions and file formats can be found here:

Package manager distributions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].