Skip to main content

A library to detect the operating system, its version, architecture, etc.

Project description

sys-detection

https://pypi.org/project/sys-detection/

Allows identifiying the current operating system, which is helpful when building and packaging cross-platform software.

Usage as module

>>> from sys_detection import local_sys_conf

>>> local_sys_conf()
 <sys_detection.SysConfiguration system='Linux' architecture='x86_64' linux_os_release={'NAME': 'CentOS Stream', 'VERSION': '8', 'ID': 'centos', 'ID_LIKE': 'rhel fedora', 'VERSION_ID': '8', 'PLATFORM_ID': 'platform:el8', 'PRETTY_NAME': 'CentOS Stream 8', 'ANSI_COLOR': '0;31', 'CPE_NAME': 'cpe:/o:centos:centos:8', 'HOME_URL': 'https://centos.org/', 'BUG_REPORT_URL': 'https://bugzilla.redhat.com/', 'REDHAT_SUPPORT_PRODUCT': 'Red Hat Enterprise Linux 8', 'REDHAT_SUPPORT_PRODUCT_VERSION': 'CentOS Stream'} at 0x7f0123456789>

>>> local_sys_conf().id_for_packaging()
'centos8-x86_64'

>>> local_sys_conf().id_for_packaging(mid_part=['moreinfo'])
'centos8-moreinfo-x86_64'

>>> local_sys_conf().id_for_packaging(separator='_')
'centos8_x86_64'

Command-line usage

python3 -m sys_detection

Output:

centos8-x86_64

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sys_detection-1.3.4.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file sys_detection-1.3.4.tar.gz.

File metadata

  • Download URL: sys_detection-1.3.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for sys_detection-1.3.4.tar.gz
Algorithm Hash digest
SHA256 0a8d325a16e5aa98db1eb1f91d46341889bdc8fb6c7b46510c9e56957ba7a895
MD5 28407203ec8076c370f5882a1b439f41
BLAKE2b-256 8eba9cd0b38af4ef155fb0c15d714ed77f6a528a80123ff0ef8e13ef31f43e04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page