A lightweight compatibility library designed to facilitate the retrieval of system version information and various other system details
Project description
MyCompat Overview
A lightweight compatibility library designed to facilitate the retrieval of system version information and various other system details.
This library is derived from PyInstaller.compat
and incorporates a custom freezing system. This system optimizes the handling of
different variables by evaluating them only when necessary and caching their values globally, akin to Just-In-Time (JIT) compiling.
Installation
You can install the library using pip
.
pip install mycompat
The module is not supported in Python versions below 3.3.
Usage
It works just like a normal module, with a stub file to facilitate type hinting.
You can import the entire module or import specific attributes from it, just like with any other module.
from mycompat import (
is_win,
is_darwin,
is_linux
)
import mycompat
mycompat.is_win
mycompat.is_darwin
mycompat.is_linux
Optionally, you can also unfreeze all variables ahead of time using the unfreeze function provided within the module.
import mycompat
mycompat.unfreeze()
Disclaimer
The freezing feature is experimental and has not been tested in a production environment. While it is not dangerous to use, its effectiveness in improving performance has not been proven.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mycompat-0.1.1.tar.gz
.
File metadata
- Download URL: mycompat-0.1.1.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3166fd1e06b3144dde95597718d849d90225e98dcc90c94058fe70a1c2bd380f |
|
MD5 | f5204aa3b35c5f888585f702db8ce421 |
|
BLAKE2b-256 | bfd2de3fec1cf5fd7e49e4ac56dbe77a2185e162ec593a833700732d80685fb5 |
File details
Details for the file mycompat-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: mycompat-0.1.1-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbdc8453e48835479ba5efd665207ecaf5446f3489f19efd3d5e512c06b17f63 |
|
MD5 | 28067903a17cf8d45571ca9bf518ff4a |
|
BLAKE2b-256 | 3c99a18c6ea05e29f5b99ccb959c57852f9dafbd92ddffaa13b58356b7a087e7 |