Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nk412/pyfzf
A python wrapper for fzf
https://github.com/nk412/pyfzf
Last synced: about 1 month ago
JSON representation
A python wrapper for fzf
- Host: GitHub
- URL: https://github.com/nk412/pyfzf
- Owner: nk412
- License: mit
- Created: 2015-11-16T00:20:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T18:26:00.000Z (over 1 year ago)
- Last Synced: 2024-07-24T13:59:41.966Z (5 months ago)
- Language: Python
- Size: 51.8 KB
- Stars: 179
- Watchers: 8
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
pyfzf
=====![](https://img.shields.io/badge/license-MIT-green.svg?style=flat)
![https://pypi.python.org/pypi/pyfzf](https://img.shields.io/pypi/dm/pyfzf.svg?style=flat)
##### A python wrapper for *junegunn*'s awesome [fzf](https://github.com/junegunn/fzf).![](https://raw.githubusercontent.com/nk412/pyfzf/master/pyfzf.gif)
Requirements
------------* Python 3.6+
* [fzf](https://github.com/junegunn/fzf)*Note*: fzf must be installed and available on PATH.
Installation
------------
pip install pyfzfUsage
-----
>>> from pyfzf.pyfzf import FzfPrompt
>>> fzf = FzfPrompt()If `fzf` is not available on PATH, you can specify a location
>>> fzf = FzfPrompt('/path/to/fzf')
Simply pass a list of options to the prompt function to invoke fzf.
>>> fzf.prompt(range(0,10))
You can pass additional arguments to fzf as a second argument
>>> fzf.prompt(range(0,10), '--multi --cycle')
Note that `pyfzf` respects all [`fzf` environment variables](https://github.com/junegunn/fzf#environment-variables).
For example, if you include the following line in your shell's rc fileFZF_DEFAULT_OPTS="--multi --cycle"
then the above Python REPL line can be simplified to
>>> fzf.prompt(range(0,10))
Input items are written to a temporary file which is then passed to fzf.
The items are delimited with `\n` by default, you can also change the delimiter
(useful for multiline items)>>> fzf.prompt(range(0,10), '--read0', '\0')
License
-------
MITThanks
------
@brookite for adding Windows support in v0.3.0