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.1.0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

mycompat-0.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file mycompat-0.1.0.tar.gz.

File metadata

  • Download URL: mycompat-0.1.0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for mycompat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4455342d3c81eb7598e4364c36cc147cce5ce440738c758d88473fde8374c8c7
MD5 5fd74c33c50913f1f12d0255f4557c28
BLAKE2b-256 aa5a2f3be8e676e24efe44b8866ad7406aa7c5223d408ad2aa80db9fa7c3a225

See more details on using hashes here.

File details

Details for the file mycompat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mycompat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for mycompat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b642344f19d3915cca6656af81898dc5f9e22cac914cc5f314ba17961219d55a
MD5 f5800d2ca67ba74c67e386330b932278
BLAKE2b-256 d3cdeea3ff43322813a61a1d55b0336a8f254ea83a9320be9e9e91a185348152

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