Skip to main content

Pythonic interface to fzf

Project description

Latest PyPI version Build status (GitHub Actions)

Demo session

iterfzf demo session

See also the API reference.

Key features

  • No dependency but only Python is required. Prebuilt fzf binary for each platform is bundled into wheels. Everything is ready by pip install iterfzf. (Note that not wheels of all supported platforms are uploaded to PyPI as they don’t allow minor platforms e.g. FreeBSD. The complete wheels can be found from the GitHub releases.)

  • Consumes an iterable rather than a list. It makes UX way better when the input data is long but streamed from low latency network. It can begin to display items immediately after only part of items are ready, and before the complete items are ready.

  • Supports Python 3.8 or higher.

iterfzf.iterfzf(iterable, *, **options)

Consumes the given iterable of strings, and displays them using fzf. If a user chooses something it immediately returns the chosen things.

The following is the full list of parameters. Pass them as keyword arguments except for iterable which comes first:

iterable (required)

The only required parameter. Every element which this iterable yields is displayed immediately after each one is produced. In other words, the passed iterable is lazily consumed.

It can be an iterable of byte strings (e.g. [b'foo', b'bar']) or of Unicode strings (e.g. [u'foo', u'bar']), but must not be mixed (e.g. [u'foo', b'bar']). If they are byte strings the function returns bytes. If they are Unicode strings it returns Unicode strings. See also the encoding parameter.


Sorts the result if True. False by default.


True to let the user to choose more than one. A user can select items with tab/shift-tab. If multi=True the function returns a list of strings rather than a string.

False to make a user possible to choose only one. If multi=False it returns a string rather than a list.

For both modes, the function returns None if nothing is matched or a user cancelled.

False by default.

Corresponds to -m/--multi option.


The key/event bindings to pass to fzf.

Dictionary of the form {KEY: ACTION} or {EVENT: ACTION}.

Corresponds to --bind=KEYBINDS option.


If True the return type is a tuple where the first element is the query the user actually typed, and the second element is the selected output as described above and depending on the state of multi.

False by default.

Corresponds to --print-query option.

New in version 0.3.0.


The text encoding name (e.g. 'utf-8', 'ascii') to be used for encoding iterable values and decoding return values. It’s ignored when the iterable values are byte strings.

The Python’s default encoding (i.e. sys.getdefaultencoding()) is used by default.


True for extended-search mode. False to turn it off.

True by default.

True corresponds to -x/--extended option, and False corresponds to +x/--no-extended option.


False for fuzzy matching, and True for exact matching.

False by default.

Corresponds to -e/--exact option.


True for case sensitivity, and False for case insensitivity. None, the default, for smart-case match.

True corresponds to +i option and False corresponds to -i option.


The query string to be filled at first. (It can be removed by a user.)

Empty string by default.

Corresponds to -q/--query option.


The prompt sequence. ' >' by default.

Corresponds to --prompt option.


The preview command to execute. None by default.

Corresponds to --preview option.


False to disable mouse. True by default.

Corresponds to --no-mouse option.


True to enable ansi colors mode. None by default.

Corresponds to --ansi option.


True to enable cycling scrolling.

False by default.

Corresponds to --cycle option.


The iterable of extra raw options/arguments to pass to fzf.

Empty by default.

Author and license

The iterfzf library is written by Hong Minhee and distributed under GPLv3 or later.

The fzf program is written by Junegunn Choi and distributed under MIT license.


Versioning scheme

Note that iterfzf does not follow Semantic Versioning. The version consists of its own major and minor number followed by the version of bundled fzf. For example, means that iterfzf’s own major version is 1, and its own minor version is 2, plus the version of fzf it bundles is 3.4.5.

/---------- 1. iterfzf's major version
|   /------ 3. bundled fzf's major version
|   |   /-- 5. bundled fzf's patch version
|   |   |
v   v   v
  ^   ^
  |   |
  |   \---- 4. bundled fzf's minor version
  \-------- 2. iterfzf's minor version


Released on May 7, 2024. Bundles fzf 0.51.0.

  • Added bind option. [#21, #36 by Gregory.K]


Released on May 6, 2024. Bundles fzf 0.51.0.

  • Added sort option. [#18, #35 by Gregory.K]

  • Officially support Python 3.12.


Released on March 6, 2024. Bundles fzf 0.46.1.

  • Close stdin before waiting to allow --select-1 to work. [#34 by Alex Wood]


Released on November 18, 2023. Bundles fzf 0.44.0.

  • Added cycle option. [#33 by Daniele Trifirò]

  • Added __extra__ option. [#32]


Released on September 18, 2023. Bundles fzf 0.42.0.

  • Dropped Python 2.7, 3.5, 3.6, and 3.7 supports.

  • Officially support Python 3.8, 3.9, 3.10, and 3.11.

  • Dropped FreeBSD i386, Linux i686, Linux armv8l, OpenBSD i386, and Windows 32-bit supports as fzf no longer supports them.

  • Dropped OpenBSD amd64 support.

  • Except the first parameter iterable, all parameters are enforced to be keyword-only. (Note that it’s always been the recommended way to pass options, although it was not enforced.)

  • Added ansi option. [#16 by Erik Lilja]

  • The executable parameter now takes os.PathLike instead of str, which is backward compatible.

  • Added __version__ and __fzf_version__ attributes to the module.

  • Added POSIX_EXECUTABLE_NAME and WINDOWS_EXECUTABLE_NAME attributes to the module.

  • Module attribute EXECUTABLE_NAME is now a Literal['fzf', 'fzf.exe'] type, which is backward compatible with the previous str type.

  • Module attribute BUNDLED_EXECUTABLE is now Optional[pathlib.Path] type.


Released on February 9, 2020. Bundles fzf 0.20.0.

  • Dropped Python 2.6, 3.3, and 3.4 supports.

  • Officially support Python 3.7 (it anyway had worked though).

  • Marked the package as supporting type checking by following PEP 561.

  • Added preview option. [#6 by Marc Weistroff]

  • Fixed a bug which had raised IOError by selecting an option before finished to load all options on Windows. [#3 by Jeff Rimko]


Released on December 4, 2017. Bundles fzf 0.17.3.


Released on October 19, 2017. Bundles fzf 0.17.1.

  • Added missing binary wheels for macOS again. (These were missing from, the previous release.)


Released on October 16, 2017. Bundles fzf 0.17.1.

  • Added print_query option. [#1 by George Kettleborough]


Released on August 27, 2017. Bundles fzf 0.17.0.


Released on July 23, 2017. Bundles fzf 0.16.11.


Released on July 23, 2017. Bundles fzf 0.16.10.


Released on June 6, 2017. Bundles fzf 0.16.8.

  • Upgraded fzf from 0.16.7 to 0.16.8.


Released on May 20, 2017. Bundles fzf 0.16.7.

  • Made sdists (source distributions) possible to be correctly installed so that older pip, can’t deal with wheels, also can install iterfzf.


Released on May 19, 2017. Bundles fzf 0.16.7. The initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iterfzf- (1.7 MB view hashes)

Uploaded Source

Built Distributions

iterfzf- (1.6 MB view hashes)

Uploaded Python 3 Windows ARM64

iterfzf- (1.7 MB view hashes)

Uploaded Python 3 Windows x86-64

iterfzf- (1.5 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ s390x

iterfzf- (1.4 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ ppc64le

iterfzf- (1.5 MB view hashes)

Uploaded Python 3 manylinux: glibc 1.2+ x86-64 manylinux: glibc 2.17+ x86-64

iterfzf- (1.4 MB view hashes)

Uploaded Python 3 manylinux: glibc 1.2+ ARM64 manylinux: glibc 2.17+ ARM64

iterfzf- (1.5 MB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

iterfzf- (1.6 MB view hashes)

Uploaded Python 3 macOS 10.7+ x86-64 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page