Pythonic interface to fzf
Project description
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 2.7, 3.5 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. Please 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.
- multi
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.
- print_query
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.
- 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.
The Python’s default encoding (i.e. sys.getdefaultencoding()) is used by default.
- extended
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.
- exact
False for fuzzy matching, and True for exact matching.
False by default.
Corresponds to -e/--exact option.
- case_sensitive
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.
- query
The query string to be filled at first. (It can be removed by a user.)
Empty string by default.
Corresponds to -q/--query option.
- prompt
The prompt sequence. ' >' by default.
Corresponds to --prompt option.
- preview
The preview command to execute. None by default.
Corresponds to --preview option.
- mouse
False to disable mouse. True by default.
Corresponds to --no-mouse option.
Changelog
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, 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
Version 0.5.0.20.0
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]
Version 0.4.0.17.3
Released on December 4, 2017. Bundles fzf 0.17.3.
Version 0.4.0.17.1
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.)
Version 0.3.0.17.1
Released on October 16, 2017. Bundles fzf 0.17.1.
Added print_query option. [#1 by George Kettleborough]
Version 0.2.0.17.0
Released on August 27, 2017. Bundles fzf 0.17.0.
Version 0.2.0.16.11
Released on July 23, 2017. Bundles fzf 0.16.11.
Version 0.2.0.16.10
Released on July 23, 2017. Bundles fzf 0.16.10.
Version 0.2.0.16.8
Released on June 6, 2017. Bundles fzf 0.16.8.
Upgraded fzf from 0.16.7 to 0.16.8.
Version 0.2.0.16.7
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.
Version 0.1.0.16.7
Released on May 19, 2017. Bundles fzf 0.16.7. The initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file iterfzf-0.5.0.20.0.tar.gz
.
File metadata
- Download URL: iterfzf-0.5.0.20.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b6f04d87a7cba79d03c2bb83575bb4580f47502dc024a24fc5dc8c0cfbcc52f |
|
MD5 | fd3274d44adb10399bddd45a33ef6763 |
|
BLAKE2b-256 | bf73c24a5dc92cc736e77f06f4957dc2c497fbc5c951fffbccaad3d83d6bcd26 |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-win_amd64.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-win_amd64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 2, Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615d4b8aef12717774254c8b656cc8d0ff94b3651cd77359478d7d0646d69f6e |
|
MD5 | 919c72ec046d3b5d782803e5038903af |
|
BLAKE2b-256 | 1e62c578c0053676e311669396a54e45525e4766f8fc2d9e07d8ed466731b096 |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-win32.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-win32.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 2, Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c95f3c9b96eb6c84db13cadb75d8d8c1d417670f87e23aeb363dbf4b777374fe |
|
MD5 | 58194cfbe4dd5f56fe6e12c23292b438 |
|
BLAKE2b-256 | 7c7c3d1b9c6ed4e4e41a955bad73163962a92f41c100f79579977ec3062d41e7 |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1461f482949d6b0441031722f101c44ac74e60cc3f5b04a9568b3da5aac8a7f2 |
|
MD5 | d9a4e68288e52317b99737a24a4e6d37 |
|
BLAKE2b-256 | 4e454e6a7a4c781b7a27a23f52fc3039e446a792a540f6e43c4566455a438cc8 |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-manylinux1_i686.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-manylinux1_i686.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d19abc3e4ae31af575835e4ffa0215327864a5123d200682e9d68dc2166558d |
|
MD5 | cc2759ec594f6e996a048d940c238a81 |
|
BLAKE2b-256 | 306ce67ae86249b43b51c3046fb8c47afb77fbcdd3ea35b2a17d153aeb0bd9a0 |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.macosx_10_12_intel.macosx_10_12_x86_64.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.macosx_10_12_intel.macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 2, Python 3, macOS 10.10+ intel, macOS 10.10+ x86-64, macOS 10.11+ intel, macOS 10.11+ x86-64, macOS 10.12+ intel, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebf54265e70154d166d6e56f9314a375ce8752937e6faf6f4fd72477472772f6 |
|
MD5 | b726215edd92332d21206935d6555337 |
|
BLAKE2b-256 | 1aa32211be3ba418e037748cad3c68e558d22f6f638a978254b24632e85cee1b |
File details
Details for the file iterfzf-0.5.0.20.0-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
.
File metadata
- Download URL: iterfzf-0.5.0.20.0-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 2, Python 3, macOS 10.10+ i386, macOS 10.11+ i386, macOS 10.12+ i386
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb6279465a8384c61c4a08867de65babca6584eabc620847ba7ce5b8afe59ae7 |
|
MD5 | 515ef09b3c9179bfc4e6b560ed4a7b90 |
|
BLAKE2b-256 | e5c791ab6e2f2a1d2885aba4703e1616c376471da95ff8eab55898492bfcf22a |