Red-Sys
Access platform details from a single object.
Description
This module has a number of class objects, with properties derived from the platform and sys modules (part of Python's stdlib).
The cross-platform, main object of red-sys is the PlatformInfo class (defined in domain.platform.schemas). This class has properties like machine, which prints the machine's architecture (i.e. x86_x84), system (i.e. Linux), and more.
PlatformInfo also has details about the Python interpreter running a script where PlatformInfo is called. PlatformInfo.python has details like the interpreter's version, implementation, path, and more. You can view the class at domain.platform.schemas.PlatformPython.
Usage
Import the PlatformInfo object. 2 methods:
- An initialized CONSTANT
- Import with:
from red_sys import PLATFORM - The
PLATFORMinstance will be initialized from the environment.- Equivalent to
PLATFORM = PlatformInfo()
- Equivalent to
- Import with:
- Use the
.get_platform()function- Import the function with
from red_sysinfo.utils import platform_utils - Define a variable, i.e.
PLATFORM = platform_utils.get_platform()- Variable will contain an initialized instance of
PlatformInfo
- Variable will contain an initialized instance of
- Import the function with
- Initialize an instance of the
PlatformInfoclass-
from red_sys import PlatformInfo p: PlatformInfo = PlatformInfo() print(p.system())
-
To print a pre-formatted platform report, import the print_platform() function from red_sysinfo.domain.platform.utils and pass a PlatformInfo object.
Example:
from red_sysinfo import PLATFORM, print_platform()
print_platform(p=PLATFORM)
Optionally, call print_platform(print_large_values=True) to print values with a large output, like PLATFORM.python.modules.
The PlatformInfoBase class defines a number of functions and properties that children classes (classes inheriting from PlatformInfoBase, i.e. "PlatformInfo(PlatformInfoBase):") can access.
.is_<platform>()functions, which return a bool if platform is detected.is_linux().is_unix().is_win().is_mac().is_java()
.is_<arch>functions, which return a bool if CPU architecture is detected.is_32bit().is_64bit()
.as_dict()function- Returns representation of class as a Python
dict - Usage:
PLATFORM.is_dict()
- Returns representation of class as a Python
Enums
red-sys also has a number of enumerators for constants. These are defined in domain.enums.platform, and are separated by platform.
Links
Metadata
Release files for red_sysinfo 0.1.2
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 |
|---|---|---|---|---|
| red_sysinfo-0.1.2.tar.gz | 9.2 kB | Without provenance | Details for red_sysinfo-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| red_sysinfo-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for red_sysinfo-0.1.2-py3-none-any.whl |
Total release size: 21.1 kB
Release files / red_sysinfo-0.1.2.tar.gz
| Download URL | red_sysinfo-0.1.2.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0e6c98886debbe5a33e79135b66038585c159a95cf2c390fa5ade1b1bb6a7d3
|
|
BLAKE2b-256 checksum How to use checksums |
0b6b2054df061a2c6db0dbcfc34456a97d05aa957392c95c935378b6b3104d07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.10.0 CPython/3.11.5
|
Release files / red_sysinfo-0.1.2-py3-none-any.whl
| Download URL | red_sysinfo-0.1.2-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb639c76475264d07ea1b8d95bae5f48e24f00650858360837731043e9158b58
|
|
BLAKE2b-256 checksum How to use checksums |
b1fed33ca4243ee83fc21771991ef73829db0fba2a85e6b0cd36b97387cdde4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.10.0 CPython/3.11.5
|
Security for red_sysinfo 0.1.2
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.