Simple operating system detection method for Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Malte Bublitz 4ad24a5a84 Merge branch 'master' of 4 years ago
tests Added pytest tests 5 years ago
.gitignore Added .html files to .gitignore 6 years ago
.travis.yml Fixed .travis.yml (replaced tabs by spaces) 5 years ago Updated 7 years ago Reformatted 7 years ago
LICENSE Added LICENSE file 4 years ago Added __doc__ string 5 years ago Added Travis CI build status image to 5 years ago Added GitHub URL and website to 4 years ago

OSDetect Build Status

What is OSDetect?

OSDetect is a small python module which is able to get some information about your system and python implementation, like the Operating System or the hardware platform.

Supported operating systems

As of now, only GNU/Linux, Mac OS X, Windows NT and Windows NT/Cygwin are supported. At the moment, I'm working on support for a wider range of operating systems.

Since version 1.1.0, Python 2 and Python 3 are both supported.

Note that the information available on the different platforms may differ.

Installation instructions

Since OSDetect uses setuptools, you simply need to run

python install

Command Line Usage

OSDetect includes a function which is executed if the module is directly called. So give it a try and run:

python -m OSDetect

Example uses of the module

# Get a dict containing all gathered information
from OSDetect import info as os_info

# Get a specific value
# or using the dict key (a dot means a dict containing a dict)

On a ArchLinux system, it looks like this:

	'Python': {
		'Version': '3.6.0',
		'Implementation': 'CPython'
	'Machine': 'i686',
	'OS': 'Linux',
	'OSVersion': '4.10.6-1-ARCH',
	'Distribution': 'Arch Linux'