Skip to main content

feature-check - query a program for supported features

The feature_check library obtains the list of supported features from a program via various methods and allows programs to check for the presence and, possibly, versions of specific features.

The feature_check library is fully typed.

Obtaining the features supported by a program

The obtain_features() function in the feature_check module runs a program with the appropriate option to obtain its list of features; the default is to pass the --features option, but this may be overridden. The obtain_features() function then examines the output to find a line that matches the specified prefix (or the default Features: prefix) and expects the rest of the line to be a whitespace-separated list of either feature names or name=version pairs. It returns a dictionary of the features obtained with their versions (or 1.0 if only a feature name was found in the program's output).

import feature_check

data = feature_check.obtain_features("timelimit")
print(data.get("subsecond", "not supported"))

For programs that need a different command-line option to list features:

import feature_check

print("SSL" in feature_check.obtain_features("curl", option="--version"))

Testing for feature versions

The feature_check library also provides a simple expression evaluation mechanism for examining feature versions - the expr module defines several Expr and Result classes and also provides the parse_simple() function (also exported by feature_check() itself) for creating simple version comparisons:

import feature_check

data = feature_check.obtain_features("timelimit")
expr = feature_check.parse_simple("subsecond >= 1")
print(expr.evaluate(data).value)

Contact the author

For more information, please see the feature_check library's homepage or contact the author, Peter Pentchev.

Metadata

Release files for feature-check 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feature-check 2.4.0
File Size Uploaded Provenance Actions
feature_check-2.4.0.tar.gz 68.0 kB Without provenance Details for feature_check-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for feature-check 2.4.0
File Interpreter ABI Platform Actions
feature_check-2.4.0-py3-none-any.whl Python 3 none any Details for feature_check-2.4.0-py3-none-any.whl

Total release size: 80.7 kB

Release files / feature_check-2.4.0.tar.gz

Download URL feature_check-2.4.0.tar.gz
Size 68.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6bf09dd0f8f89fbc9f982e12a0a470807700a306c9b72da7fa530f44ec5fe72d
BLAKE2b-256 checksum
How to use checksums
7ee940e1fbe3436d3eb43d4fa32094c462c671bf8bb5da11ddec718cffe09d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / feature_check-2.4.0-py3-none-any.whl

Download URL feature_check-2.4.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
953e9e840e861cf6ef28f0ccb88f2c51eab55496172fdcc1f3df1df0716b3876
BLAKE2b-256 checksum
How to use checksums
ca31e16fa02cd3e02b417c886ee4df022d4aadfbfe3c11d94b52f4248dbf845d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for feature-check 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page