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


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.8.tar.gz (8.6 kB view details)

Uploaded Source

Built Distributions

iterfzf-0.2.0.16.8-py2.py3-none-win_amd64.whl (2.3 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

iterfzf-0.2.0.16.8-py2.py3-none-manylinux1_x86_64.whl (874.4 kB view details)

Uploaded Python 2 Python 3

iterfzf-0.2.0.16.8-py2.py3-none-manylinux1_i686.whl (812.5 kB view details)

Uploaded Python 2 Python 3

iterfzf-0.2.0.16.8-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 (867.1 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.8-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl (809.5 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.8.tar.gz.

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.8.tar.gz
Algorithm Hash digest
SHA256 6b9e3bbaefdb50d148925caa71dc3b2b259bee19094d01e64eab8f8f73c51c95
MD5 da1fb64fe1a5b70d97b55b30274b2ccb
BLAKE2b-256 3bd2e23f19f75e3ef66d11dcf0c5f8cfbb382fb52ddb76f40bf083a28231de94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.8-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f668ade42b814c9e47ae65e509e3b8cc5249a3b2e36e756214149e6c4f882d44
MD5 5102989c87c83a159ef6f642f69c6ed9
BLAKE2b-256 40f821e4bba5445d27327c8d39d5c22f659bb4fe7bfb1ba52658a75187d9ea3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.8-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 56f44c82b261b4edcdcdc2ca5de1f8c335275229473401cb2463e1ad5c6e5e14
MD5 daf96c0a08d706fbf1fbed33e52703de
BLAKE2b-256 7a206525b345ee7ba19c5fc92ed1d2e921fefb4f0179ff737e2fdf25eb16044f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.8-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e790678eac2c1a5a596b8c910543413da7b0e1ab3e02cc27b00e3473925c9407
MD5 a13ca0608b70b2376714d1675697c4fc
BLAKE2b-256 65c73dbb39a28db0315c05d8a849879a82b9fe53a5d3ddb36f4587c9bb7c6547

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iterfzf-0.2.0.16.8-py2.py3-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 a6cc9611d6ce151295c16c14dafc418e65dcd64e1fc56f60517691d6af5a5b73
MD5 9ba8a0d0b50fc8fbc0a1d7aeb690962f
BLAKE2b-256 f2cfe054b0058d47ebc087aabf8307cea5f81b3071c1704c86874dea5ea6da2e

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.8-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.8-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 66b606349853bddcba50c2ac4616df9e0b168e07c8773bb5f2f6d16817d5cf7a
MD5 fa99542e62a8564324d55d3dfe341d95
BLAKE2b-256 66ddadbcc9e68c0d98a77fe7438f7a4ba2737c2b6eec711d648d01103853ec81

See more details on using hashes here.

File details

Details for the file iterfzf-0.2.0.16.8-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.8-py2.py3-none-macosx_10_10_i386.macosx_10_11_i386.macosx_10_12_i386.whl
Algorithm Hash digest
SHA256 7116c490274a055a390655fa03a4543c3e55224c7e4d545dc18ec2e6640371fe
MD5 3999fff86527e0eaff33e7a4b33b061f
BLAKE2b-256 65879c52ed1dd0d045bab8295224e6ef1a1f5b278af55d55b56becaea4b74090

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