See also the API reference.
- No dependency but only Python is required. Prebuilt
fzf
binary for each platform is bundled into wheels. Everything is ready bypip 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.
Consumes the given iterable
of strings, and displays them using fzf
.
If a user chooses something it immediately returns the chosen things. If the
user cancels the selection, the KeywordInterrupt exception will be raised.
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 passediterable
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 theencoding
parameter.
Keyword | Default | CLI option | Description |
---|---|---|---|
ansi |
None |
--ansi |
New in version 1.0.0. |
bind |
--bind |
The key/event bindings to pass to Dictionary of the form {KEY: ACTION} or {EVENT: ACTION}. New in version 1.4.0. |
|
case_sensitive |
None |
--smart-case |
|
color |
None |
--color |
Accepts color scheme name or a dictionary in the form of {element: color}. New in version 1.6.0. |
cycle |
False |
--cycle |
New in version 1.1.0. |
encoding |
sys.getdefaultencoding() |
--encoding |
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. |
exact |
False |
--exact |
False for fuzzy matching, and True for exact matching. |
extended |
True |
--extended
--no-extended |
|
header |
None |
--header |
Sticky header printed below prompt. New in version 1.6.0. |
mouse |
True |
--no-mouse |
False to disable mouse. |
multi |
False |
--multi |
For both modes, the function returns |
preview |
None |
--preview |
New in version 0.5.0. |
print_query |
False |
--print-query |
If New in version 0.3.0. |
prompt |
" >" |
--prompt |
|
query |
"" (empty string) |
--query |
The query string to be filled at first. (It can be removed by a user.) |
sort |
False |
--sort |
Sorts the result if New in version 1.3.0. |
__extra__ |
[] |
The iterable of extra raw options/arguments to pass to This is how you pass extra options that are not already defined as keyword arguments. New in version 1.1.0. |
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.
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, 1.2.3.4.5 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
1.2.3.4.5
^ ^
| |
| \---- 4. bundled fzf's minor version
\-------- 2. iterfzf's minor version
To be released. Bundles fzf
0.60.3.
Released on March 11, 2025. Bundles fzf
0.60.3.
Released on March 5, 2025. Bundles fzf
0.60.2.
- Added support for raising
KeyboardInterrupt
. [#40 by Phred Lane] - Officially support Python 3.13.
Released on March 1, 2025. Bundles fzf
0.60.2.
Released on August 24, 2024. Bundles fzf
0.54.3.
Released on May 7, 2024. Bundles fzf
0.51.0.
Released on May 6, 2024. Bundles fzf
0.51.0.
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.
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 takesos.PathLike
instead ofstr
, which is backward compatible. - Added
__version__
and__fzf_version__
attributes to the module. - Added
POSIX_EXECUTABLE_NAME
andWINDOWS_EXECUTABLE_NAME
attributes to the module. - Module attribute
EXECUTABLE_NAME
is now aLiteral['fzf', 'fzf.exe']
type, which is backward compatible with the previousstr
type. - Module attribute
BUNDLED_EXECUTABLE
is nowOptional[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 0.3.0.17.1, 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 installiterfzf
.
Released on May 19, 2017. Bundles fzf
0.16.7. The initial release.