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.
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.6, 2.7, 3.3 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 make a user possible 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.
- 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.
- mouse
False to disable mouse. True by default.
Corresponds to --no-mouse option.
Changelog
Versioning scheme
Note that iterfzf doesn’t 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.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 Distributions
Built Distributions
File details
Details for the file iterfzf-0.1.0.16.7-py2.py3-none-win_amd64.whl
.
File metadata
- Download URL: iterfzf-0.1.0.16.7-py2.py3-none-win_amd64.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 2, Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f865a4af874c7a841cb530ee86e73c6e232372abb7efa03a6b7970fcb97cd71 |
|
MD5 | 7e3ddc914fe58c7ce4961d09283c359b |
|
BLAKE2b-256 | f24218b032fea0ea988ec7daa8e86b4f158f9708ad4356da786e05bb9d3c1d0c |
File details
Details for the file iterfzf-0.1.0.16.7-py2.py3-none-win32.whl
.
File metadata
- Download URL: iterfzf-0.1.0.16.7-py2.py3-none-win32.whl
- Upload date:
- Size: 2.3 MB
- Tags: Python 2, Python 3, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48753e341636e4b2a49e63cdc9d78e837197fbff25b708ba98140141b3c42c2f |
|
MD5 | 56afcbf48510af24ae7e61a770c98058 |
|
BLAKE2b-256 | 845851f284cda1ec419ee4f7b6155a0bdcc6247939f6a9b2ca1c1416cdb0d4bf |
File details
Details for the file iterfzf-0.1.0.16.7-py2.py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: iterfzf-0.1.0.16.7-py2.py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 811.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b504c9877876b057bbcae5e9e919a029930c8fa2635707469b91fd299e53e6c |
|
MD5 | 05a20fb949b126341465f8f6f7d97503 |
|
BLAKE2b-256 | 3e64394dea629cf08e68a898f60e749918639f3bcce99a20b73064133746ab73 |
File details
Details for the file iterfzf-0.1.0.16.7-py2.py3-none-manylinux1_i686.whl
.
File metadata
- Download URL: iterfzf-0.1.0.16.7-py2.py3-none-manylinux1_i686.whl
- Upload date:
- Size: 811.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1e08fdab40860f46ed694a9d6edfe9ba9ca316e5d7447fa81f569c97cc82623 |
|
MD5 | a687a3370cc0dcb6b14117084bb1977e |
|
BLAKE2b-256 | 9856a3fdb6a3d7f9169e733496d8082130c65c36bde635781e99df8129b6f95b |
File details
Details for the file iterfzf-0.1.0.16.7-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.1.0.16.7-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: 866.3 kB
- 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f73782ac5f4a9f5e4844c3fc624edd870d6d36c89bb10320b3e71b4f87a9f4f1 |
|
MD5 | 18745319b83c043d0ef07327bfbef72d |
|
BLAKE2b-256 | a9594bde5f4d8c6ac8f61f1b807f5e5d225ed43ff33fe3309c2e36039d20ee42 |
File details
Details for the file iterfzf-0.1.0.16.7-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
.
File metadata
- Download URL: iterfzf-0.1.0.16.7-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
- Upload date:
- Size: 808.9 kB
- Tags: Python 2, Python 3, macOS 10.10+ i386, macOS 10.11+ i386, macOS 10.12+ i386
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3433ebfc79911793952b326b6fd627214ce897fc1fc5758cdb2473b92121acab |
|
MD5 | 4491876e2e8da3b94b4b4452a7c9da43 |
|
BLAKE2b-256 | 0f6b9002db12df81989532c766784f62efd1c68fd40fab87fec08816f9705069 |