<commit_before>Linux Distribution - a Linux OS platform information API
========================================================

[![Build Status](https://travis-ci.org/nir0s/ld.svg?branch=master)](https://travis-ci.org/nir0s/ld)
[![PyPI downloads](http://img.shields.io/pypi/dm/ld.svg)](https://pypi.python.org/pypi/ld)
[![PyPI version](http://img.shields.io/pypi/v/ld.svg)](https://pypi.python.org/pypi/ld)


The `ld` (for: Linux Distribution) package provides information about the
Linux distribution it runs on, such as a reliable machine-readable ID, or
version information.

It is a renewed alternative implementation for Python's
original `platform.linux_distribution` function, but it also provides much more
functionality.
An alternative implementation became necessary because Python 3.5 deprecated
this function, and Python 3.7 is expected to remove it altogether.
Its predecessor function `platform.dist` was already deprecated since
Python 2.6 and is also expected to be removed in Python 3.7.
Still, there are many cases in which access to that information is needed.
See [Python issue 1322](https://bugs.python.org/issue1322) for more
information.

The `ld` package implements a robust and inclusive way of retrieving the
information about a Linux 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.


## Installation

At this point, the latest version on PyPI is v0.2.9:

```shell
pip install ld
```

The latest released version is v0.5.0
([Release Page](https://github.com/nir0s/ld/releases/tag/v0.5.0)),
which is not yet on PyPI but can be installed from GitHub as follows:

```shell
pip install https://github.com/nir0s/ld/archive/v0.5.0.tar.gz<commit_msg>Updated README.md file (for GitHub) to bring statement about released versions on PyPI up to date with v0.5.0 being released.<commit_after>Linux Distribution - a Linux OS platform information API
========================================================

[![Build Status](https://travis-ci.org/nir0s/ld.svg?branch=master)](https://travis-ci.org/nir0s/ld)
[![PyPI downloads](http://img.shields.io/pypi/dm/ld.svg)](https://pypi.python.org/pypi/ld)
[![PyPI version](http://img.shields.io/pypi/v/ld.svg)](https://pypi.python.org/pypi/ld)


The `ld` (for: Linux Distribution) package provides information about the
Linux distribution it runs on, such as a reliable machine-readable ID, or
version information.

It is a renewed alternative implementation for Python's
original `platform.linux_distribution` function, but it also provides much more
functionality.
An alternative implementation became necessary because Python 3.5 deprecated
this function, and Python 3.7 is expected to remove it altogether.
Its predecessor function `platform.dist` was already deprecated since
Python 2.6 and is also expected to be removed in Python 3.7.
Still, there are many cases in which access to that information is needed.
See [Python issue 1322](https://bugs.python.org/issue1322) for more
information.

The `ld` package implements a robust and inclusive way of retrieving the
information about a Linux 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.


## Installation

Installation of the latest released version from PyPI:

```shell
pip install ld
{'fraction_non_alphanumeric': 0.13012958963282936, 'fraction_numerical': 0.014308855291576673, 'mean_word_length': 4.995145631067961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7068943', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1016, 'n_words': 414}