Skip to main content

Pythonic interface to fzf

Project description

Latest PyPI version Build status (Travis CI) Build status (AppVeyor)

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

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.

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


Download files

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

Source Distribution

iterfzf-0.2.0.16.7.tar.gz (8.5 kB view details)

Uploaded Source

Built Distributions

iterfzf-0.2.0.16.7-py2.py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

iterfzf-0.2.0.16.7-py2.py3-none-win32.whl (2.2 MB view details)

Uploaded Python 2 Python 3 Windows x86

iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_x86_64.whl (873.6 kB view details)

Uploaded Python 2 Python 3

iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_i686.whl (812.3 kB view details)

Uploaded Python 2 Python 3

iterfzf-0.2.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 (809.3 kB view details)

Uploaded 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

iterfzf-0.2.0.16.7-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl (809.3 kB view details)

Uploaded Python 2 Python 3 macOS 10.10+ i386 macOS 10.11+ i386 macOS 10.12+ i386

File details

Details for the file iterfzf-0.2.0.16.7.tar.gz.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7.tar.gz
Algorithm Hash digest
SHA256 dac65bde201e0ccdb9ab7384247a6e4ae75665b9de79b6a91df666edb368902e
MD5 04c25f7410ebc6cb509270dfebf24af7
BLAKE2b-256 ab8707793d7a3ee8d236abcd3c1bf8566ebeb7ddf1ced15e79eb2a266f546f2d

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.7-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 be9822bee01327697e13f52bfff7a99d128105bfc3308346d3f8cebed2226529
MD5 745f2f6bd49cd0cc3261b71fd270d251
BLAKE2b-256 e42e0da1cb334866746fac62cd7997a9a3b35218b7a7b6b1fc6a8131bce7a307

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.7-py2.py3-none-win32.whl.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 b7570e9fe7c89200f390e4fd6c46e71a5afecb6ea4c71cde97a5af672b4fd3ce
MD5 ad353a5aff2fae8593d183f45b8d1d82
BLAKE2b-256 e594a929f8fcb432b2b7e778bcb452ee231baf813de5ddd24f5e34b679b07995

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 197c28f4b5fc4f2dd0c44010b54592c69c36fa848fbb28a1974863296f8fdc3d
MD5 aaa74578a4c0d410005437e4c62c2288
BLAKE2b-256 ab96747bec69dc3c5c40a4eb860528ac4ee13a1725f1b5dde528b96002fc7811

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_i686.whl.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7-py2.py3-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 96cc02f40b9f662a26eb3e3411ad48bbc9d562f4fed8d8bca5ba43bfcb2a4881
MD5 305b329b7e783821a2dfaa57269a74cb
BLAKE2b-256 bf44cf9f6e329192beeabd718852c907624dc160cd0b80606adb67280cb62c51

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.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

File hashes

Hashes for iterfzf-0.2.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
Algorithm Hash digest
SHA256 afc80763c795be9223085e2e01763270da4df88db8b84f4022b6add517f704f8
MD5 1fc0c7a73dd201cf21393d7a87c5b457
BLAKE2b-256 41bfb0332ccdacf122d7f4025225bef3e381bcdd08ae93f9b1c486a5e61dd7e9

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.7-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.7-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
Algorithm Hash digest
SHA256 c92a0fb0dac62113ff8b971e18b988754fe65a24cc26afcb4d89cd1849943a12
MD5 bf92d04da72665fa73593acf55b5868f
BLAKE2b-256 de26ce0c5e33188116112eb2ad8e2bd9ad7982c14f3b9e07b552246993833224

See more details on using hashes here.

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