pyfzf - Python FZF Wrapper
pyfzf is a Python wrapper for junegunn's fuzzyfinder (fzf), enabling Python applications to leverage fzf's interactive filtering capabilities directly from Python. The library is actively maintained, with its latest version 0.3.1 released in March 2022, and typically sees updates for feature enhancements and platform compatibility.
Warnings
- breaking pyfzf officially requires Python 3.6+. Older versions (prior to 0.2.1) might have supported Python 2, but modern usage expects Python 3.6+.
- breaking The `plumbum` dependency was removed in version 0.3.0. If your application indirectly relied on `plumbum` through pyfzf, it will no longer be available.
- gotcha The `fzf` binary (junegunn's fuzzy-finder) must be installed on your system and accessible via the system PATH. pyfzf is a wrapper and does not bundle the fzf executable itself. If not found, `FzfPrompt` can be initialized with the full path to the `fzf` binary.
- gotcha Unicode support on Windows was improved significantly in version 0.3.1. Users on Windows experiencing issues with non-ASCII characters should upgrade.
Install
-
pip install pyfzf
Imports
- FzfPrompt
from pyfzf.pyfzf import FzfPrompt
Quickstart
from pyfzf.pyfzf import FzfPrompt
fzf = FzfPrompt()
options = ['apple', 'banana', 'cherry', 'date']
selected_items = fzf.prompt(options, '--multi')
if selected_items:
print(f"You selected: {', '.join(selected_items)}")
else:
print("No item selected.")