pyfzf - Python FZF Wrapper

0.3.1 · active · verified Tue Apr 14

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

Install

Imports

Quickstart

Initializes FzfPrompt and displays a list of options using fzf, allowing for multi-selection. The selected items are returned as a list. You can pass additional fzf command-line arguments as a second argument to the `prompt` method.

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.")

view raw JSON →