Home¶
Overview¶
feu (French word for "fire" 🔥) is a lightweight Python library designed to help manage Python
packages and their versions across different Python environments. It provides utilities to:
- Check package availability: Verify if packages and modules are available in your environment
- Install packages intelligently: Install packages with version compatibility checks for your target environment
- Version management: Find the closest valid package version for your target environment
- Package configuration: Maintain a registry of known package version compatibility, and discover it automatically from PyPI when it isn't already registered
- GitHub metadata: Fetch and sort repository metadata from the GitHub API
The library is particularly useful for projects that need to support multiple Python versions, free-threaded builds, OSes, and CPU architectures, and want to ensure they install compatible package versions.
Key Features¶
- Target-aware: Automatically selects compatible package versions based on the Python version, free-threadedness, OS, and CPU architecture
- CLI interface: Command-line tools for package management tasks
- Lightweight: Minimal dependencies (only
packagingrequired for core functionality) - Extensible: Registry of common packages (numpy, pandas, polars, torch, etc.) with known version constraints, plus PyPI-backed discovery for anything not in the registry
Quick Example¶
from feu import is_package_available, get_package_version
from feu.compat import Target, find_closest_version
# Check if a package is available
if is_package_available("numpy"):
version = get_package_version("numpy")
print(f"NumPy {version} is installed!")
# Find the closest valid version for your Python version
version = find_closest_version(
pkg_name="numpy", pkg_version="2.0.2", target=Target(python_version="3.10")
)
print(f"Closest valid version: {version}")
Documentation¶
API stability¶
While
feu is in development stage, no API is guaranteed to be stable from one
release to the next. In fact, it is very likely that the API will change multiple times before a
stable 1.0.0 release. In practice, this means that upgrading feu to a new version will
possibly break any code that was using the old version of feu.
License¶
feu is licensed under BSD 3-Clause "New" or "Revised" license available
in LICENSE file.