Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
A lightweight compatibility library designed to facilitate the retrieval of system version information and various other system details
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.
You can install the library using pip
.
pip install mycompat
The module is not supported in Python versions below 3.3.
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()
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.
FAQs
A lightweight compatibility library designed to facilitate the retrieval of system version information and various other system details
We found that mycompat demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.