Skip to main content

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


Download files

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

Source Distribution

mycompat-0.0.0.tar.gz (44.3 kB view hashes)

Uploaded Source

Built Distribution

mycompat-0.0.0-py3-none-any.whl (33.0 kB view hashes)

Uploaded Python 3

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