Socket
Socket
Sign inDemoInstall

mycompat

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycompat

A lightweight compatibility library designed to facilitate the retrieval of system version information and various other system details


Maintainers
1

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc