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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mycompat-0.0.0.tar.gz
Algorithm Hash digest
SHA256 c26e236769b0161ee5f5f60f6cd4a1b491f2f8f24d38b70bf6b268db11dbe5fc
MD5 132721526c3a6eea5bd96fa16a46e074
BLAKE2b-256 d383ed4ba53cbc291f6a459b187018c33646784834ff54e4ab4060cfd32185bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mycompat-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.0 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64575f17da5ebeb6ee3880c1ea3eae1c4ce9d03853b8a1f869f0d7281795b6c6
MD5 81b19a4e10c2d1ade784fc0ec3a3cd82
BLAKE2b-256 7729bec876b7ebfcf2c3f9f8acacecc78b1367a83bcafa163dc0800c68b518b8

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