Checks what os is running
Tested against Windows 10/Android/Linux / Python 3.11 / Anaconda
pip install osversionchecker
The main focus is differentiating classic Linux / Android
Determines the operating system by analyzing various system characteristics
and assigns points based on detected features. The OS with the highest points
is considered the active operating system.
Returns:
tuple: A dictionary with the points for each operating system and the
name of the detected active operating system.
The function checks the following:
- If the sys.executable path indicates a Windows system.
- If the sys.executable path starts with '/data/data/' indicating an Android system.
- The count of backslashes and slashes in the environment variables string.
- The presence of certain files or directories that are specific to Windows or Android.
- The output of certain shell commands that indicate an Android system.
- The content of the uname command output to check for Linux, Darwin (macOS), or Android.
- The platform information from the platform module to check for Linux, Darwin (macOS), or Android.
- The sys.platform value to check for Linux, Darwin (macOS), Windows, or Android.
- The sys.version string to check for Linux, Darwin (macOS), or Windows.
from osversionchecker import check_os
os_system_points, active_os_system = check_os()
print(active_os_system)
print(os_system_points)
windows
{'windows': 5, 'linux': 0, 'darwin': 0, 'android': 0}
Metadata
Release files for osversionchecker 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| osversionchecker-0.10.tar.gz | 4.2 kB | Without provenance | Details for osversionchecker-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| osversionchecker-0.10-py3-none-any.whl | Python 3 | none | any | Details for osversionchecker-0.10-py3-none-any.whl |
Total release size: 10.4 kB
Release files / osversionchecker-0.10.tar.gz
| Download URL | osversionchecker-0.10.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eac17ae86ac196d845c46c797b02c4db485de74888a5bd112e2c32efa2c39c21
|
|
BLAKE2b-256 checksum How to use checksums |
09a1560a1ed6f0b4623ba097b3e080d83feb96b503eea76240d07f93faaa882c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / osversionchecker-0.10-py3-none-any.whl
| Download URL | osversionchecker-0.10-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4eda7e1a4e8642defb4db0dca8f25c2415d52a5ed74bc7fabc1d37fccdc0df3
|
|
BLAKE2b-256 checksum How to use checksums |
349bd378068e4b1c43a62f0fdac4001d8b2a062a7a2e27bf5301c51e31003ac6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for osversionchecker 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.