├── .gitignore ├── .editorconfig ├── examples ├── pokemon.py ├── kv.py └── pokemon.txt ├── tox.ini ├── .github └── workflows │ ├── test.yaml │ └── release.yaml ├── pyproject.toml ├── iterfzf ├── test_iterfzf.py └── __init__.py ├── README.rst └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info/ 2 | *.pyc 3 | .*.swp 4 | .mypy_cache/ 5 | .tox/ 6 | __pycache__/ 7 | build/ 8 | dist/ 9 | fzf-*-release.json 10 | iterfzf/fzf 11 | iterfzf/fzf.exe 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | max_line_length = 80 10 | tab_width = 4 11 | 12 | [*.py] 13 | max_line_length = 79 14 | 15 | [*.{yaml,yml}] 16 | indent_size = 2 17 | tab_width = 2 18 | -------------------------------------------------------------------------------- /examples/pokemon.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | import time 3 | 4 | from iterfzf import iterfzf 5 | 6 | 7 | def iter_pokemon(sleep=0.01): 8 | filename = os.path.join(os.path.dirname(__file__), 'pokemon.txt') 9 | with open(filename) as f: 10 | for l in f: 11 | yield l.strip() 12 | time.sleep(sleep) 13 | 14 | 15 | def main(): 16 | result = iterfzf(iter_pokemon(), multi=True) 17 | for item in result: 18 | print(repr(item)) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | min_version = 4 3 | envlist = py{38,39,310,311,312,313,py3}-{wheel,sdist} 4 | 5 | [base] 6 | commands = 7 | python -c "import sys; sys.path.remove(''); from iterfzf import BUNDLED_EXECUTABLE as e; assert e" 8 | python -c "import sys; sys.path.remove(''); from iterfzf import BUNDLED_EXECUTABLE as e; import os; assert os.execl(e, e, '--version') == 0" 9 | python -c "import sys; sys.path.remove(''); from iterfzf import iterfzf; assert iterfzf(list()) is None" 10 | python -c "import sys; sys.path.remove(''); from iterfzf import iterfzf; assert iterfzf(list(), multi=True) is None" 11 | 12 | [testenv:wheel] 13 | commands = {[base]commands} 14 | package = wheel 15 | 16 | [testenv:sdist] 17 | commands = {[base]commands} 18 | package = sdist 19 | -------------------------------------------------------------------------------- /examples/kv.py: -------------------------------------------------------------------------------- 1 | """Currently ``fzf`` and ``iterfzf()`` takes only some kind of strings, 2 | so you can't pass arbitrary Python objects into that. Also there is no way 3 | to give each item some "hidden keys" besides displayed values. 4 | 5 | Therefore, if you want to show items in a dictionary, and make users to choose 6 | some items, then get chosen item keys, you need to give ``iterfzf()`` string 7 | representations of key-value pairs. Here's an example: 8 | 9 | """ 10 | from iterfzf import iterfzf 11 | 12 | 13 | def fzf_dict(d, multi): 14 | r"""This assumes keys must have no tabs, hence ``'\t'`` as a separator.""" 15 | options = ('{0}\t{1}'.format(k, v) for k, v in d.items()) 16 | for kv in iterfzf(options, multi=multi): 17 | yield kv[:kv.index('\t')] 18 | 19 | 20 | def main(): 21 | d = { 22 | '1': 'foo', 23 | '2': 'bar', 24 | '3': 'spam', 25 | '4': 'egg', 26 | } 27 | print(iterfzf(d.values())) 28 | keys = fzf_dict(d, multi=True) 29 | for key in keys: 30 | print(repr(key), '=>', repr(d[key])) 31 | 32 | 33 | if __name__ == '__main__': 34 | main() 35 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: test 2 | on: 3 | pull_request: {} 4 | push: 5 | branches: 6 | - "*" 7 | 8 | jobs: 9 | test: 10 | strategy: 11 | matrix: 12 | os: 13 | - ubuntu-latest 14 | - windows-latest 15 | # FIXME Temporarily disabled macOS as tox hangs on it for some unknown 16 | # reason, even though it works fine locally: 17 | # - macos-latest 18 | runs-on: ${{ matrix.os }} 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: actions/setup-python@v5 22 | with: 23 | python-version: | 24 | 3.8 25 | 3.9 26 | 3.10 27 | 3.11 28 | 3.12 29 | 3.13 30 | pypy3.10 31 | - uses: install-pinned/tox@36b53081efa7a6522c78c2f5ebc40c55b60463ef 32 | - run: | 33 | set -e 34 | if [[ "$RUNNER_DEBUG" = "1" ]]; then 35 | debug_options="--verbose" 36 | fi 37 | tox --exit-and-dump-after 60 $debug_options 38 | shell: bash 39 | env: 40 | GITHUB_TOKEN: ${{ github.token }} 41 | 42 | format: 43 | runs-on: ubuntu-latest 44 | steps: 45 | - uses: actions/checkout@v4 46 | - uses: AlexanderMelde/yapf-action@master 47 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "iterfzf" 3 | description = "Pythonic interface to fzf" 4 | readme = "README.rst" 5 | keywords = ["fzf"] 6 | classifiers = [ 7 | "Development Status :: 4 - Beta", 8 | "Environment :: Console :: Curses", 9 | "Intended Audience :: Developers", 10 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", 11 | "Operating System :: MacOS :: MacOS X", 12 | "Operating System :: Microsoft :: Windows", 13 | "Operating System :: POSIX :: BSD :: FreeBSD", 14 | "Operating System :: POSIX :: BSD :: OpenBSD", 15 | "Operating System :: POSIX :: Linux", 16 | "Programming Language :: Python :: 3.8", 17 | "Programming Language :: Python :: 3.9", 18 | "Programming Language :: Python :: 3.10", 19 | "Programming Language :: Python :: 3.11", 20 | "Programming Language :: Python :: 3.12", 21 | "Programming Language :: Python :: 3.13", 22 | "Programming Language :: Python :: Implementation :: CPython", 23 | "Programming Language :: Python :: Implementation :: PyPy", 24 | "Topic :: Terminals", 25 | ] 26 | authors = [ 27 | { name = "Hong Minhee (洪 民憙)", email = "hong@minhee.org" }, 28 | ] 29 | license = { file = "LICENSE" } 30 | requires-python = ">= 3.8" 31 | dynamic = ["version"] 32 | 33 | [project.urls] 34 | "Source Code" = "https://github.com/dahlia/iterfzf" 35 | "Issue Tracker" = "https://github.com/dahlia/iterfzf/issues" 36 | Downloads = "https://github.com/dahlia/iterfzf/releases" 37 | 38 | [build] 39 | sdist = true 40 | 41 | [build-system] 42 | requires = ["flit_core >= 3.2, < 4", "packaging >= 22"] 43 | backend-path = ["."] 44 | build-backend = "build_dist" 45 | 46 | [tool.flit.sdist] 47 | include = ["build_dist.py", "iterfzf/fzf-*-release.json"] 48 | exclude = ["iterfzf/fzf", "itefzf/fzf.exe"] 49 | 50 | [tool.yapfignore] 51 | ignore_patterns = [ 52 | ".tox" 53 | ] 54 | 55 | [tool.yapf] 56 | based_on_style = "pep8" 57 | column_limit = 79 58 | dedent_closing_brackets = true 59 | indent_dictionary_value = true 60 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | tags: 5 | - "*.*.*" 6 | branches: 7 | - "*" 8 | pull_request: {} 9 | 10 | jobs: 11 | release: 12 | runs-on: ubuntu-latest 13 | environment: 14 | name: pypi 15 | url: https://pypi.org/p/iterfzf 16 | permissions: 17 | id-token: write 18 | contents: write 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: actions/setup-python@v5 22 | with: 23 | python-version: "3.x" 24 | - run: pip3 install build 25 | - run: | 26 | set -e 27 | GOOS=darwin GOARCH=amd64 python3 -m build --sdist --wheel . 28 | GOOS=darwin GOARCH=arm64 python3 -m build --sdist --wheel . 29 | GOOS=freebsd GOARCH=amd64 python3 -m build --sdist --wheel . 30 | GOOS=linux GOARCH=amd64 python3 -m build --sdist --wheel . 31 | GOOS=linux GOARCH=arm64 python3 -m build --sdist --wheel . 32 | GOOS=linux GOARCH=armv5 python3 -m build --sdist --wheel . 33 | GOOS=linux GOARCH=armv6 python3 -m build --sdist --wheel . 34 | GOOS=linux GOARCH=armv7 python3 -m build --sdist --wheel . 35 | GOOS=linux GOARCH=ppc64le python3 -m build --sdist --wheel . 36 | GOOS=linux GOARCH=s390x python3 -m build --sdist --wheel . 37 | GOOS=windows GOARCH=amd64 python3 -m build --sdist --wheel . 38 | GOOS=windows GOARCH=arm64 python3 -m build --sdist --wheel . 39 | shell: bash 40 | - uses: actions/upload-artifact@v4 41 | with: 42 | name: dist 43 | path: dist 44 | - if: github.ref_type == 'tag' 45 | uses: softprops/action-gh-release@v1 46 | with: 47 | files: | 48 | dist/iterfzf-*.tar.gz 49 | dist/iterfzf-*.whl 50 | - run: | 51 | set -e 52 | # Remove unsupported wheels 53 | rm dist/iterfzf-*-freebsd_*.whl 54 | rm dist/iterfzf-*-manylinux_1_2_armv*l.whl 55 | shell: bash 56 | - if: github.ref_type == 'tag' 57 | uses: pypa/gh-action-pypi-publish@release/v1 58 | -------------------------------------------------------------------------------- /iterfzf/test_iterfzf.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest.mock import MagicMock, patch 3 | 4 | import iterfzf 5 | 6 | flavors = [ 7 | "Chocolate", "Chocolate Chip", "Vanilla", "Strawberry", "Blueberry", 8 | "Rocky Road" 9 | ] 10 | 11 | 12 | class IterFzfTest(unittest.TestCase): 13 | 14 | def test_no_query(self): 15 | choice = iterfzf.iterfzf(flavors, executable="fzf") 16 | self.assertEqual("Chocolate", choice) 17 | 18 | def test_supports_color_kwarg(self): 19 | choice = iterfzf.iterfzf( 20 | flavors, 21 | executable="fzf", 22 | color={ 23 | "fg": "#d0d0d0", 24 | "bg": "#121212", 25 | "hl": "#5f87af", 26 | "fg+": "#d0d0d0", 27 | "bg+": "#262626", 28 | "hl+": "#5fd7ff", 29 | "info": "#afaf87", 30 | "prompt": "#d7005f", 31 | "pointer": "#af5fff", 32 | "marker": "#87ff00", 33 | "spinner": "#af5fff", 34 | "header": "#87afaf", 35 | } 36 | ) 37 | self.assertEqual("Chocolate", choice) 38 | 39 | def test_select_one(self): 40 | choice = iterfzf.iterfzf( 41 | flavors, query="Vani", __extra__=["-1"], executable="fzf" 42 | ) 43 | self.assertEqual("Vanilla", choice) 44 | 45 | def test_support_header_kwarg(self): 46 | choice = iterfzf.iterfzf( 47 | flavors, 48 | query="Vani", 49 | __extra__=["-1"], 50 | executable="fzf", 51 | header="The header should not cause errors", 52 | ) 53 | self.assertEqual("Vanilla", choice) 54 | 55 | def test_select_one_ambiguous(self): 56 | choice = iterfzf.iterfzf( 57 | flavors, query="Choc", __extra__=["-1"], executable="fzf" 58 | ) 59 | self.assertTrue(choice.rfind('Chocolate') == 0) 60 | 61 | @patch("subprocess.Popen") 62 | def test_raises_keyboard_interrupt(self, mock_open): 63 | mock_process = MagicMock() 64 | mock_open.return_value = mock_process 65 | 66 | mock_process.wait.return_value = iterfzf.INTERRUPT_EXIT_CODE 67 | 68 | self.assertRaises( 69 | KeyboardInterrupt, 70 | lambda: iterfzf.iterfzf(flavors, executable="fzf"), 71 | ) 72 | 73 | def test_support_tmux_bool(self): 74 | choice = iterfzf.iterfzf( 75 | flavors, 76 | query="Vani", 77 | __extra__=["-1"], 78 | executable="fzf", 79 | tmux=True, 80 | ) 81 | self.assertEqual("Vanilla", choice) 82 | 83 | def test_support_tmux_str(self): 84 | choice = iterfzf.iterfzf( 85 | flavors, 86 | query="Vani", 87 | __extra__=["-1"], 88 | executable="fzf", 89 | tmux="top,60%", 90 | ) 91 | self.assertEqual("Vanilla", choice) -------------------------------------------------------------------------------- /iterfzf/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | import errno 4 | from os import fspath, PathLike 5 | from pathlib import Path 6 | import subprocess 7 | import sys 8 | from typing import AnyStr, Iterable, Literal, Mapping, Optional, Union 9 | 10 | __all__ = '__fzf_version__', '__version__', 'BUNDLED_EXECUTABLE', 'iterfzf' 11 | 12 | __fzf_version__ = '0.62.0' 13 | __version__ = '1.9.' + __fzf_version__ 14 | 15 | POSIX_EXECUTABLE_NAME: Literal['fzf'] = 'fzf' 16 | WINDOWS_EXECUTABLE_NAME: Literal['fzf.exe'] = 'fzf.exe' 17 | EXECUTABLE_NAME: Literal['fzf', 'fzf.exe'] = \ 18 | WINDOWS_EXECUTABLE_NAME \ 19 | if sys.platform == 'win32' \ 20 | else POSIX_EXECUTABLE_NAME 21 | BUNDLED_EXECUTABLE: Optional[Path] = \ 22 | Path(__file__).parent / EXECUTABLE_NAME 23 | INTERRUPT_EXIT_CODE: int = 130 24 | 25 | 26 | def format_option(option: Mapping[str, str]) -> str: 27 | return ','.join( 28 | r"{}:{}".format(key, value) for key, value in option.items() 29 | ) 30 | 31 | 32 | def iterfzf( 33 | iterable: Iterable[AnyStr], 34 | *, 35 | # Sorting: 36 | sort: bool = False, 37 | # Search mode: 38 | extended: bool = True, 39 | exact: bool = False, 40 | case_sensitive: Optional[bool] = None, 41 | # Interface: 42 | multi: bool = False, 43 | mouse: bool = True, 44 | bind: Optional[Mapping[str, str]] = None, 45 | color: Optional[Mapping[str, str]] = None, 46 | print_query: bool = False, 47 | # Layout: 48 | prompt: str = '> ', 49 | ansi: bool = False, 50 | header: str = '', 51 | preview: Optional[str] = None, 52 | tmux: Optional[Union[str, bool]] = False, 53 | # Misc: 54 | query: str = '', 55 | cycle: bool = False, 56 | __extra__: Iterable[str] = (), 57 | encoding: Optional[str] = None, 58 | executable: PathLike = BUNDLED_EXECUTABLE or EXECUTABLE_NAME 59 | ): 60 | cmd = [fspath(executable), '--prompt=' + prompt] 61 | if not sort: 62 | cmd.append('--no-sort') 63 | if not extended: 64 | cmd.append('--no-extended') 65 | if case_sensitive is not None: 66 | cmd.append('+i' if case_sensitive else '-i') 67 | if exact: 68 | cmd.append('--exact') 69 | if multi: 70 | cmd.append('--multi') 71 | if not mouse: 72 | cmd.append('--no-mouse') 73 | if bind: 74 | cmd.append('--bind=' + format_option(bind)) 75 | if color: 76 | cmd.append('--color=' + format_option(color)) 77 | if print_query: 78 | cmd.append('--print-query') 79 | if query: 80 | cmd.append('--query=' + query) 81 | if preview: 82 | cmd.append('--preview=' + preview) 83 | if tmux: 84 | cmd.append('--tmux' if tmux is True else f'--tmux={tmux}') 85 | if header: 86 | cmd.append('--header=' + header) 87 | if ansi: 88 | cmd.append('--ansi') 89 | if cycle: 90 | cmd.append('--cycle') 91 | if __extra__: 92 | cmd.extend(__extra__) 93 | encoding = encoding or sys.getdefaultencoding() 94 | proc = None 95 | stdin = None 96 | byte = None 97 | lf = u'\n' 98 | cr = u'\r' 99 | for line in iterable: 100 | if byte is None: 101 | byte = isinstance(line, bytes) 102 | if byte: 103 | lf = b'\n' 104 | cr = b'\r' 105 | elif isinstance(line, bytes) is not byte: 106 | raise ValueError( 107 | 'element values must be all byte strings or all ' 108 | 'unicode strings, not mixed of them: ' + repr(line) 109 | ) 110 | if lf in line or cr in line: 111 | raise ValueError( 112 | r"element values must not contain CR({1!r})/" 113 | r"LF({2!r}): {0!r}".format(line, cr, lf) 114 | ) 115 | if proc is None: 116 | proc = subprocess.Popen( 117 | cmd, 118 | stdin=subprocess.PIPE, 119 | stdout=subprocess.PIPE, 120 | stderr=None 121 | ) 122 | stdin = proc.stdin 123 | if not byte: 124 | line = line.encode(encoding) 125 | try: 126 | stdin.write(line + b'\n') 127 | stdin.flush() 128 | except IOError as e: 129 | if e.errno != errno.EPIPE and errno.EPIPE != 32: 130 | raise 131 | break 132 | try: 133 | stdin.close() 134 | except IOError as e: 135 | if e.errno != errno.EPIPE and errno.EPIPE != 32: 136 | raise 137 | exit_code = proc.wait() if proc else -1 138 | if exit_code == INTERRUPT_EXIT_CODE: 139 | raise KeyboardInterrupt() 140 | 141 | if exit_code not in [0, 1]: 142 | if print_query: 143 | return None, None 144 | else: 145 | return None 146 | stdout = proc.stdout 147 | decode = (lambda b: b) if byte else (lambda t: t.decode(encoding)) 148 | output = [decode(ln.strip(b'\r\n\0')) for ln in iter(stdout.readline, b'')] 149 | if print_query: 150 | try: 151 | if multi: 152 | return output[0], output[1:] 153 | else: 154 | return output[0], output[1] 155 | except IndexError: 156 | return output[0], None 157 | else: 158 | if multi: 159 | return output 160 | else: 161 | try: 162 | return output[0] 163 | except IndexError: 164 | return None 165 | -------------------------------------------------------------------------------- /examples/pokemon.txt: -------------------------------------------------------------------------------- 1 | #001 Bulbasaur 2 | #002 Ivysaur 3 | #003 Venusaur 4 | #004 Charmander 5 | #005 Charmeleon 6 | #006 Charizard 7 | #007 Squirtle 8 | #008 Wartortle 9 | #009 Blastoise 10 | #010 Caterpie 11 | #011 Metapod 12 | #012 Butterfree 13 | #013 Weedle 14 | #014 Kakuna 15 | #015 Beedrill 16 | #016 Pidgey 17 | #017 Pidgeotto 18 | #018 Pidgeot 19 | #019 Rattata 20 | #020 Raticate 21 | #021 Spearow 22 | #022 Fearow 23 | #023 Ekans 24 | #024 Arbok 25 | #025 Pikachu 26 | #026 Raichu 27 | #027 Sandshrew 28 | #028 Sandslash 29 | #029 Nidoran♀ 30 | #030 Nidorina 31 | #031 Nidoqueen 32 | #032 Nidoran♂ 33 | #033 Nidorino 34 | #034 Nidoking 35 | #035 Clefairy 36 | #036 Clefable 37 | #037 Vulpix 38 | #038 Ninetales 39 | #039 Jigglypuff 40 | #040 Wigglytuff 41 | #041 Zubat 42 | #042 Golbat 43 | #043 Oddish 44 | #044 Gloom 45 | #045 Vileplume 46 | #046 Paras 47 | #047 Parasect 48 | #048 Venonat 49 | #049 Venomoth 50 | #050 Diglett 51 | #051 Dugtrio 52 | #052 Meowth 53 | #053 Persian 54 | #054 Psyduck 55 | #055 Golduck 56 | #056 Mankey 57 | #057 Primeape 58 | #058 Growlithe 59 | #059 Arcanine 60 | #060 Poliwag 61 | #061 Poliwhirl 62 | #062 Poliwrath 63 | #063 Abra 64 | #064 Kadabra 65 | #065 Alakazam 66 | #066 Machop 67 | #067 Machoke 68 | #068 Machamp 69 | #069 Bellsprout 70 | #070 Weepinbell 71 | #071 Victreebel 72 | #072 Tentacool 73 | #073 Tentacruel 74 | #074 Geodude 75 | #075 Graveler 76 | #076 Golem 77 | #077 Ponyta 78 | #078 Rapidash 79 | #079 Slowpoke 80 | #080 Slowbro 81 | #081 Magnemite 82 | #082 Magneton 83 | #083 Farfetch'd 84 | #084 Doduo 85 | #085 Dodrio 86 | #086 Seel 87 | #087 Dewgong 88 | #088 Grimer 89 | #089 Muk 90 | #090 Shellder 91 | #091 Cloyster 92 | #092 Gastly 93 | #093 Haunter 94 | #094 Gengar 95 | #095 Onix 96 | #096 Drowzee 97 | #097 Hypno 98 | #098 Krabby 99 | #099 Kingler 100 | #100 Voltorb 101 | #101 Electrode 102 | #102 Exeggcute 103 | #103 Exeggutor 104 | #104 Cubone 105 | #105 Marowak 106 | #106 Hitmonlee 107 | #107 Hitmonchan 108 | #108 Lickitung 109 | #109 Koffing 110 | #110 Weezing 111 | #111 Rhyhorn 112 | #112 Rhydon 113 | #113 Chansey 114 | #114 Tangela 115 | #115 Kangaskhan 116 | #116 Horsea 117 | #117 Seadra 118 | #118 Goldeen 119 | #119 Seaking 120 | #120 Staryu 121 | #121 Starmie 122 | #122 Mr. Mime 123 | #123 Scyther 124 | #124 Jynx 125 | #125 Electabuzz 126 | #126 Magmar 127 | #127 Pinsir 128 | #128 Tauros 129 | #129 Magikarp 130 | #130 Gyarados 131 | #131 Lapras 132 | #132 Ditto 133 | #133 Eevee 134 | #134 Vaporeon 135 | #135 Jolteon 136 | #136 Flareon 137 | #137 Porygon 138 | #138 Omanyte 139 | #139 Omastar 140 | #140 Kabuto 141 | #141 Kabutops 142 | #142 Aerodactyl 143 | #143 Snorlax 144 | #144 Articuno 145 | #145 Zapdos 146 | #146 Moltres 147 | #147 Dratini 148 | #148 Dragonair 149 | #149 Dragonite 150 | #150 Mewtwo 151 | #151 Mew 152 | #152 Chikorita 153 | #153 Bayleef 154 | #154 Meganium 155 | #155 Cyndaquil 156 | #156 Quilava 157 | #157 Typhlosion 158 | #158 Totodile 159 | #159 Croconaw 160 | #160 Feraligatr 161 | #161 Sentret 162 | #162 Furret 163 | #163 Hoothoot 164 | #164 Noctowl 165 | #165 Ledyba 166 | #166 Ledian 167 | #167 Spinarak 168 | #168 Ariados 169 | #169 Crobat 170 | #170 Chinchou 171 | #171 Lanturn 172 | #172 Pichu 173 | #173 Cleffa 174 | #174 Igglybuff 175 | #175 Togepi 176 | #176 Togetic 177 | #177 Natu 178 | #178 Xatu 179 | #179 Mareep 180 | #180 Flaaffy 181 | #181 Ampharos 182 | #182 Bellossom 183 | #183 Marill 184 | #184 Azumarill 185 | #185 Sudowoodo 186 | #186 Politoed 187 | #187 Hoppip 188 | #188 Skiploom 189 | #189 Jumpluff 190 | #190 Aipom 191 | #191 Sunkern 192 | #192 Sunflora 193 | #193 Yanma 194 | #194 Wooper 195 | #195 Quagsire 196 | #196 Espeon 197 | #197 Umbreon 198 | #198 Murkrow 199 | #199 Slowking 200 | #200 Misdreavus 201 | #201 Unown 202 | #202 Wobbuffet 203 | #203 Girafarig 204 | #204 Pineco 205 | #205 Forretress 206 | #206 Dunsparce 207 | #207 Gligar 208 | #208 Steelix 209 | #209 Snubbull 210 | #210 Granbull 211 | #211 Qwilfish 212 | #212 Scizor 213 | #213 Shuckle 214 | #214 Heracross 215 | #215 Sneasel 216 | #216 Teddiursa 217 | #217 Ursaring 218 | #218 Slugma 219 | #219 Magcargo 220 | #220 Swinub 221 | #221 Piloswine 222 | #222 Corsola 223 | #223 Remoraid 224 | #224 Octillery 225 | #225 Delibird 226 | #226 Mantine 227 | #227 Skarmory 228 | #228 Houndour 229 | #229 Houndoom 230 | #230 Kingdra 231 | #231 Phanpy 232 | #232 Donphan 233 | #233 Porygon2 234 | #234 Stantler 235 | #235 Smeargle 236 | #236 Tyrogue 237 | #237 Hitmontop 238 | #238 Smoochum 239 | #239 Elekid 240 | #240 Magby 241 | #241 Miltank 242 | #242 Blissey 243 | #243 Raikou 244 | #244 Entei 245 | #245 Suicune 246 | #246 Larvitar 247 | #247 Pupitar 248 | #248 Tyranitar 249 | #249 Lugia 250 | #250 Ho-Oh 251 | #251 Celebi 252 | #252 Treecko 253 | #253 Grovyle 254 | #254 Sceptile 255 | #255 Torchic 256 | #256 Combusken 257 | #257 Blaziken 258 | #258 Mudkip 259 | #259 Marshtomp 260 | #260 Swampert 261 | #261 Poochyena 262 | #262 Mightyena 263 | #263 Zigzagoon 264 | #264 Linoone 265 | #265 Wurmple 266 | #266 Silcoon 267 | #267 Beautifly 268 | #268 Cascoon 269 | #269 Dustox 270 | #270 Lotad 271 | #271 Lombre 272 | #272 Ludicolo 273 | #273 Seedot 274 | #274 Nuzleaf 275 | #275 Shiftry 276 | #276 Taillow 277 | #277 Swellow 278 | #278 Wingull 279 | #279 Pelipper 280 | #280 Ralts 281 | #281 Kirlia 282 | #282 Gardevoir 283 | #283 Surskit 284 | #284 Masquerain 285 | #285 Shroomish 286 | #286 Breloom 287 | #287 Slakoth 288 | #288 Vigoroth 289 | #289 Slaking 290 | #290 Nincada 291 | #291 Ninjask 292 | #292 Shedinja 293 | #293 Whismur 294 | #294 Loudred 295 | #295 Exploud 296 | #296 Makuhita 297 | #297 Hariyama 298 | #298 Azurill 299 | #299 Nosepass 300 | #300 Skitty 301 | #301 Delcatty 302 | #302 Sableye 303 | #303 Mawile 304 | #304 Aron 305 | #305 Lairon 306 | #306 Aggron 307 | #307 Meditite 308 | #308 Medicham 309 | #309 Electrike 310 | #310 Manectric 311 | #311 Plusle 312 | #312 Minun 313 | #313 Volbeat 314 | #314 Illumise 315 | #315 Roselia 316 | #316 Gulpin 317 | #317 Swalot 318 | #318 Carvanha 319 | #319 Sharpedo 320 | #320 Wailmer 321 | #321 Wailord 322 | #322 Numel 323 | #323 Camerupt 324 | #324 Torkoal 325 | #325 Spoink 326 | #326 Grumpig 327 | #327 Spinda 328 | #328 Trapinch 329 | #329 Vibrava 330 | #330 Flygon 331 | #331 Cacnea 332 | #332 Cacturne 333 | #333 Swablu 334 | #334 Altaria 335 | #335 Zangoose 336 | #336 Seviper 337 | #337 Lunatone 338 | #338 Solrock 339 | #339 Barboach 340 | #340 Whiscash 341 | #341 Corphish 342 | #342 Crawdaunt 343 | #343 Baltoy 344 | #344 Claydol 345 | #345 Lileep 346 | #346 Cradily 347 | #347 Anorith 348 | #348 Armaldo 349 | #349 Feebas 350 | #350 Milotic 351 | #351 Castform 352 | #352 Kecleon 353 | #353 Shuppet 354 | #354 Banette 355 | #355 Duskull 356 | #356 Dusclops 357 | #357 Tropius 358 | #358 Chimecho 359 | #359 Absol 360 | #360 Wynaut 361 | #361 Snorunt 362 | #362 Glalie 363 | #363 Spheal 364 | #364 Sealeo 365 | #365 Walrein 366 | #366 Clamperl 367 | #367 Huntail 368 | #368 Gorebyss 369 | #369 Relicanth 370 | #370 Luvdisc 371 | #371 Bagon 372 | #372 Shelgon 373 | #373 Salamence 374 | #374 Beldum 375 | #375 Metang 376 | #376 Metagross 377 | #377 Regirock 378 | #378 Regice 379 | #379 Registeel 380 | #380 Latias 381 | #381 Latios 382 | #382 Kyogre 383 | #383 Groudon 384 | #384 Rayquaza 385 | #385 Jirachi 386 | #386 Deoxys 387 | #387 Turtwig 388 | #388 Grotle 389 | #389 Torterra 390 | #390 Chimchar 391 | #391 Monferno 392 | #392 Infernape 393 | #393 Piplup 394 | #394 Prinplup 395 | #395 Empoleon 396 | #396 Starly 397 | #397 Staravia 398 | #398 Staraptor 399 | #399 Bidoof 400 | #400 Bibarel 401 | #401 Kricketot 402 | #402 Kricketune 403 | #403 Shinx 404 | #404 Luxio 405 | #405 Luxray 406 | #406 Budew 407 | #407 Roserade 408 | #408 Cranidos 409 | #409 Rampardos 410 | #410 Shieldon 411 | #411 Bastiodon 412 | #412 Burmy 413 | #413 Wormadam 414 | #414 Mothim 415 | #415 Combee 416 | #416 Vespiquen 417 | #417 Pachirisu 418 | #418 Buizel 419 | #419 Floatzel 420 | #420 Cherubi 421 | #421 Cherrim 422 | #422 Shellos 423 | #423 Gastrodon 424 | #424 Ambipom 425 | #425 Drifloon 426 | #426 Drifblim 427 | #427 Buneary 428 | #428 Lopunny 429 | #429 Mismagius 430 | #430 Honchkrow 431 | #431 Glameow 432 | #432 Purugly 433 | #433 Chingling 434 | #434 Stunky 435 | #435 Skuntank 436 | #436 Bronzor 437 | #437 Bronzong 438 | #438 Bonsly 439 | #439 Mime Jr. 440 | #440 Happiny 441 | #441 Chatot 442 | #442 Spiritomb 443 | #443 Gible 444 | #444 Gabite 445 | #445 Garchomp 446 | #446 Munchlax 447 | #447 Riolu 448 | #448 Lucario 449 | #449 Hippopotas 450 | #450 Hippowdon 451 | #451 Skorupi 452 | #452 Drapion 453 | #453 Croagunk 454 | #454 Toxicroak 455 | #455 Carnivine 456 | #456 Finneon 457 | #457 Lumineon 458 | #458 Mantyke 459 | #459 Snover 460 | #460 Abomasnow 461 | #461 Weavile 462 | #462 Magnezone 463 | #463 Lickilicky 464 | #464 Rhyperior 465 | #465 Tangrowth 466 | #466 Electivire 467 | #467 Magmortar 468 | #468 Togekiss 469 | #469 Yanmega 470 | #470 Leafeon 471 | #471 Glaceon 472 | #472 Gliscor 473 | #473 Mamoswine 474 | #474 Porygon-Z 475 | #475 Gallade 476 | #476 Probopass 477 | #477 Dusknoir 478 | #478 Froslass 479 | #479 Rotom 480 | #480 Uxie 481 | #481 Mesprit 482 | #482 Azelf 483 | #483 Dialga 484 | #484 Palkia 485 | #485 Heatran 486 | #486 Regigigas 487 | #487 Giratina 488 | #488 Cresselia 489 | #489 Phione 490 | #490 Manaphy 491 | #491 Darkrai 492 | #492 Shaymin 493 | #493 Arceus 494 | #494 Victini 495 | #495 Snivy 496 | #496 Servine 497 | #497 Serperior 498 | #498 Tepig 499 | #499 Pignite 500 | #500 Emboar 501 | #501 Oshawott 502 | #502 Dewott 503 | #503 Samurott 504 | #504 Patrat 505 | #505 Watchog 506 | #506 Lillipup 507 | #507 Herdier 508 | #508 Stoutland 509 | #509 Purrloin 510 | #510 Liepard 511 | #511 Pansage 512 | #512 Simisage 513 | #513 Pansear 514 | #514 Simisear 515 | #515 Panpour 516 | #516 Simipour 517 | #517 Munna 518 | #518 Musharna 519 | #519 Pidove 520 | #520 Tranquill 521 | #521 Unfezant 522 | #522 Blitzle 523 | #523 Zebstrika 524 | #524 Roggenrola 525 | #525 Boldore 526 | #526 Gigalith 527 | #527 Woobat 528 | #528 Swoobat 529 | #529 Drilbur 530 | #530 Excadrill 531 | #531 Audino 532 | #532 Timburr 533 | #533 Gurdurr 534 | #534 Conkeldurr 535 | #535 Tympole 536 | #536 Palpitoad 537 | #537 Seismitoad 538 | #538 Throh 539 | #539 Sawk 540 | #540 Sewaddle 541 | #541 Swadloon 542 | #542 Leavanny 543 | #543 Venipede 544 | #544 Whirlipede 545 | #545 Scolipede 546 | #546 Cottonee 547 | #547 Whimsicott 548 | #548 Petilil 549 | #549 Lilligant 550 | #550 Basculin 551 | #551 Sandile 552 | #552 Krokorok 553 | #553 Krookodile 554 | #554 Darumaka 555 | #555 Darmanitan 556 | #556 Maractus 557 | #557 Dwebble 558 | #558 Crustle 559 | #559 Scraggy 560 | #560 Scrafty 561 | #561 Sigilyph 562 | #562 Yamask 563 | #563 Cofagrigus 564 | #564 Tirtouga 565 | #565 Carracosta 566 | #566 Archen 567 | #567 Archeops 568 | #568 Trubbish 569 | #569 Garbodor 570 | #570 Zorua 571 | #571 Zoroark 572 | #572 Minccino 573 | #573 Cinccino 574 | #574 Gothita 575 | #575 Gothorita 576 | #576 Gothitelle 577 | #577 Solosis 578 | #578 Duosion 579 | #579 Reuniclus 580 | #580 Ducklett 581 | #581 Swanna 582 | #582 Vanillite 583 | #583 Vanillish 584 | #584 Vanilluxe 585 | #585 Deerling 586 | #586 Sawsbuck 587 | #587 Emolga 588 | #588 Karrablast 589 | #589 Escavalier 590 | #590 Foongus 591 | #591 Amoonguss 592 | #592 Frillish 593 | #593 Jellicent 594 | #594 Alomomola 595 | #595 Joltik 596 | #596 Galvantula 597 | #597 Ferroseed 598 | #598 Ferrothorn 599 | #599 Klink 600 | #600 Klang 601 | #601 Klinklang 602 | #602 Tynamo 603 | #603 Eelektrik 604 | #604 Eelektross 605 | #605 Elgyem 606 | #606 Beheeyem 607 | #607 Litwick 608 | #608 Lampent 609 | #609 Chandelure 610 | #610 Axew 611 | #611 Fraxure 612 | #612 Haxorus 613 | #613 Cubchoo 614 | #614 Beartic 615 | #615 Cryogonal 616 | #616 Shelmet 617 | #617 Accelgor 618 | #618 Stunfisk 619 | #619 Mienfoo 620 | #620 Mienshao 621 | #621 Druddigon 622 | #622 Golett 623 | #623 Golurk 624 | #624 Pawniard 625 | #625 Bisharp 626 | #626 Bouffalant 627 | #627 Rufflet 628 | #628 Braviary 629 | #629 Vullaby 630 | #630 Mandibuzz 631 | #631 Heatmor 632 | #632 Durant 633 | #633 Deino 634 | #634 Zweilous 635 | #635 Hydreigon 636 | #636 Larvesta 637 | #637 Volcarona 638 | #638 Cobalion 639 | #639 Terrakion 640 | #640 Virizion 641 | #641 Tornadus 642 | #642 Thundurus 643 | #643 Reshiram 644 | #644 Zekrom 645 | #645 Landorus 646 | #646 Kyurem 647 | #647 Keldeo 648 | #648 Meloetta 649 | #649 Genesect 650 | #650 Chespin 651 | #651 Quilladin 652 | #652 Chesnaught 653 | #653 Fennekin 654 | #654 Braixen 655 | #655 Delphox 656 | #656 Froakie 657 | #657 Frogadier 658 | #658 Greninja 659 | #659 Bunnelby 660 | #660 Diggersby 661 | #661 Fletchling 662 | #662 Fletchinder 663 | #663 Talonflame 664 | #664 Scatterbug 665 | #665 Spewpa 666 | #666 Vivillon 667 | #667 Litleo 668 | #668 Pyroar 669 | #669 Flabébé 670 | #670 Floette 671 | #671 Florges 672 | #672 Skiddo 673 | #673 Gogoat 674 | #674 Pancham 675 | #675 Pangoro 676 | #676 Furfrou 677 | #677 Espurr 678 | #678 Meowstic 679 | #679 Honedge 680 | #680 Doublade 681 | #681 Aegislash 682 | #682 Spritzee 683 | #683 Aromatisse 684 | #684 Swirlix 685 | #685 Slurpuff 686 | #686 Inkay 687 | #687 Malamar 688 | #688 Binacle 689 | #689 Barbaracle 690 | #690 Skrelp 691 | #691 Dragalge 692 | #692 Clauncher 693 | #693 Clawitzer 694 | #694 Helioptile 695 | #695 Heliolisk 696 | #696 Tyrunt 697 | #697 Tyrantrum 698 | #698 Amaura 699 | #699 Aurorus 700 | #700 Sylveon 701 | #701 Hawlucha 702 | #702 Dedenne 703 | #703 Carbink 704 | #704 Goomy 705 | #705 Sliggoo 706 | #706 Goodra 707 | #707 Klefki 708 | #708 Phantump 709 | #709 Trevenant 710 | #710 Pumpkaboo 711 | #711 Gourgeist 712 | #712 Bergmite 713 | #713 Avalugg 714 | #714 Noibat 715 | #715 Noivern 716 | #716 Xerneas 717 | #717 Yveltal 718 | #718 Zygarde 719 | #719 Diancie 720 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ``iterfzf``: Pythonic interface to ``fzf`` 2 | ========================================== 3 | 4 | .. image:: https://img.shields.io/pypi/v/iterfzf 5 | :target: https://pypi.org/project/iterfzf/ 6 | :alt: Latest PyPI version 7 | 8 | .. image:: https://github.com/dahlia/iterfzf/actions/workflows/test.yaml/badge.svg 9 | :alt: Build status (GitHub Actions) 10 | :target: https://github.com/dahlia/iterfzf/actions/workflows/test.yaml 11 | 12 | 13 | Demo session 14 | ------------ 15 | 16 | .. image:: https://asciinema.org/a/121028.png 17 | :target: https://asciinema.org/a/121028 18 | :alt: iterfzf demo session 19 | 20 | See also the `API reference`_. 21 | 22 | 23 | Key features 24 | ------------ 25 | 26 | - No dependency but only Python is required. Prebuilt ``fzf`` binary for 27 | each platform is bundled into wheels. Everything is ready by 28 | ``pip install iterfzf``. (Note that not wheels of all supported platforms 29 | are uploaded to PyPI as they don't allow minor platforms e.g. FreeBSD. 30 | The complete wheels can be found from the `GitHub releases`__.) 31 | - Consumes an iterable rather than a list. It makes UX way better when the 32 | input data is long but *streamed* from low latency network. 33 | It can begin to display items immediately after only *part* of items are 34 | ready, and *before* the complete items are ready. 35 | - Supports Python 3.8 or higher. 36 | 37 | __ https://github.com/dahlia/iterfzf/releases 38 | 39 | 40 | .. _api reference: 41 | 42 | ``iterfzf.iterfzf(iterable, *, **options)`` 43 | ------------------------------------------- 44 | 45 | Consumes the given ``iterable`` of strings, and displays them using ``fzf``. 46 | If a user chooses something it immediately returns the chosen things. If the 47 | user cancels the selection, the `KeywordInterrupt` exception will be raised. 48 | 49 | The following is the full list of parameters. Pass them as 50 | **keyword arguments** except for ``iterable`` which comes first: 51 | 52 | ``iterable`` (required) 53 | The only required parameter. Every element which this ``iterable`` yields 54 | is displayed immediately after each one is produced. In other words, 55 | the passed ``iterable`` is lazily consumed. 56 | 57 | It can be an iterable of byte strings (e.g. ``[b'foo', b'bar']``) or of 58 | Unicode strings (e.g. ``[u'foo', u'bar']``), but must not be 59 | mixed (e.g. ``[u'foo', b'bar']``). If they are byte strings the function 60 | returns bytes. If they are Unicode strings it returns Unicode strings. 61 | See also the ``encoding`` parameter. 62 | 63 | .. list-table:: Keyword arguments 64 | :widths: 12 12 12 50 65 | :header-rows: 1 66 | 67 | * - Keyword 68 | - Default 69 | - CLI option 70 | - Description 71 | * - ``ansi`` 72 | - ``None`` 73 | - ``--ansi`` 74 | - ``True`` to enable ansi colors mode. 75 | 76 | *New in version 1.0.0.* 77 | * - ``bind`` 78 | - 79 | - ``--bind`` 80 | - The key/event bindings to pass to ``fzf``. 81 | 82 | Dictionary of the form {KEY: ACTION} or {EVENT: ACTION}. 83 | 84 | *New in version 1.4.0.* 85 | * - ``case_sensitive`` 86 | - ``None`` 87 | - ``--smart-case`` 88 | - ``True`` for case sensitivity, and ``False`` for case insensitivity. 89 | ``None``, the default, for smart-case match. 90 | 91 | ``True`` corresponds to ``+i`` option and ``False`` corresponds to 92 | ``-i`` option. 93 | * - ``color`` 94 | - ``None`` 95 | - ``--color`` 96 | - Accepts color scheme name or a dictionary in the form of {element: 97 | color}. 98 | 99 | *New in version 1.6.0.* 100 | * - ``cycle`` 101 | - ``False`` 102 | - ``--cycle`` 103 | - ``True`` to enable cycling scrolling. 104 | 105 | *New in version 1.1.0.* 106 | * - ``encoding`` 107 | - ``sys.getdefaultencoding()`` 108 | - ``--encoding`` 109 | - The text encoding name (e.g. ``'utf-8'``, ``'ascii'``) to be used for 110 | encoding ``iterable`` values and decoding return values. It's ignored 111 | when the ``iterable`` values are byte strings. 112 | * - ``exact`` 113 | - ``False`` 114 | - ``--exact`` 115 | - ``False`` for fuzzy matching, and ``True`` for exact matching. 116 | * - ``extended`` 117 | - ``True`` 118 | - ``--extended`` 119 | ``--no-extended`` 120 | - ``True`` for extended-search mode. ``False`` to turn it off. 121 | 122 | ``True`` corresponds to ``-x``/``--extended`` option, and 123 | ``False`` corresponds to ``+x``/``--no-extended`` option. 124 | * - ``header`` 125 | - ``None`` 126 | - ``--header`` 127 | - Sticky header printed below prompt. 128 | 129 | *New in version 1.6.0.* 130 | * - ``mouse`` 131 | - ``True`` 132 | - ``--no-mouse`` 133 | - ``False`` to disable mouse. 134 | * - ``multi`` 135 | - ``False`` 136 | - ``--multi`` 137 | - ``True`` to let the user to choose more than one. A user can select 138 | items with tab/shift-tab. If ``multi=True`` the function returns a list of 139 | strings rather than a string. 140 | 141 | ``False`` to make a user possible to choose only one. If ``multi=False`` 142 | it returns a string rather than a list. 143 | 144 | For both modes, the function returns ``None`` if nothing is matched. 145 | * - ``preview`` 146 | - ``None`` 147 | - ``--preview`` 148 | - *New in version 0.5.0.* 149 | * - ``print_query`` 150 | - ``False`` 151 | - ``--print-query`` 152 | - If ``True`` the return type is a tuple where the first element is the query 153 | the user actually typed, and the second element is the selected output as 154 | described above and depending on the state of ``multi``. 155 | 156 | *New in version 0.3.0.* 157 | * - ``prompt`` 158 | - ``" >"`` 159 | - ``--prompt`` 160 | - 161 | * - ``query`` 162 | - ``""`` (empty string) 163 | - ``--query`` 164 | - The query string to be filled at first. (It can be removed by a user.) 165 | * - ``sort`` 166 | - ``False`` 167 | - ``--sort`` 168 | - Sorts the result if ``True``. ``False`` by default. 169 | 170 | *New in version 1.3.0.* 171 | * - ``tmux`` 172 | - ``False`` 173 | - ``--tmux[=OPTS]`` 174 | - Start fzf in a tmux popup if ``tmux=True`` or the config string is 175 | provided (requires tmux 3.3+). 176 | 177 | The format of the option is like 178 | ``[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]][,border-native]`` 179 | (default: ``center,50%``). 180 | 181 | *New in version 1.7.0.* 182 | * - ``__extra__`` 183 | - ``[]`` 184 | - 185 | - The iterable of extra raw options/arguments to pass to ``fzf``. 186 | 187 | This is how you pass extra options that are not already defined 188 | as keyword arguments. 189 | 190 | *New in version 1.1.0.* 191 | 192 | 193 | Author and license 194 | ------------------ 195 | 196 | The ``iterfzf`` library is written by `Hong Minhee`__ and distributed under 197 | GPLv3_ or later. 198 | 199 | The ``fzf`` program is written by `Junegunn Choi`__ and distributed under 200 | MIT license. 201 | 202 | __ https://hongminhee.org/ 203 | .. _GPLv3: https://www.gnu.org/licenses/gpl-3.0.html 204 | __ https://junegunn.kr/ 205 | 206 | 207 | Changelog 208 | --------- 209 | 210 | Versioning scheme 211 | ~~~~~~~~~~~~~~~~~ 212 | 213 | Note that ``iterfzf`` does *not* follow `Semantic Versioning`_. The version 214 | consists of its own major and minor number followed by the version of bundled 215 | ``fzf``. For example, 1.2.3.4.5 means that ``iterfzf``'s own major version 216 | is 1, and its own minor version is 2, plus the version of ``fzf`` it bundles 217 | is 3.4.5. 218 | 219 | .. code-block:: text 220 | 221 | /---------- 1. iterfzf's major version 222 | | /------ 3. bundled fzf's major version 223 | | | /-- 5. bundled fzf's patch version 224 | | | | 225 | v v v 226 | 1.2.3.4.5 227 | ^ ^ 228 | | | 229 | | \---- 4. bundled fzf's minor version 230 | \-------- 2. iterfzf's minor version 231 | 232 | .. _Semantic Versioning: http://semver.org/ 233 | 234 | 235 | Version 1.9.0.62.0 236 | ~~~~~~~~~~~~~~~~~~ 237 | 238 | To be released. Bundles ``fzf`` `0.62.0`__. 239 | 240 | __ https://github.com/junegunn/fzf/releases/tag/v0.62.0 241 | 242 | 243 | Version 1.8.0.62.0 244 | ~~~~~~~~~~~~~~~~~~ 245 | 246 | Released on May 15, 2025. Bundles ``fzf`` `0.62.0`__. 247 | 248 | - Fixed an error when the ``iterfzf()`` function was invoked with 249 | the ``tmux=True`` option. [`#45`__ by Peter Rebrun] 250 | 251 | __ https://github.com/junegunn/fzf/releases/tag/v0.62.0 252 | __ https://github.com/dahlia/iterfzf/pull/45 253 | 254 | 255 | Version 1.7.0.62.0 256 | ~~~~~~~~~~~~~~~~~~ 257 | 258 | Released on May 10, 2025. Bundles ``fzf`` `0.62.0`__. 259 | 260 | - Added ``tmux`` option. [`#44`__ by Peter Rebrun] 261 | 262 | __ https://github.com/junegunn/fzf/releases/tag/v0.62.0 263 | __ https://github.com/dahlia/iterfzf/pull/44 264 | 265 | 266 | Version 1.6.0.60.3 267 | ~~~~~~~~~~~~~~~~~~ 268 | 269 | Released on March 11, 2025. Bundles ``fzf`` `0.60.3`__. 270 | 271 | - Added ``header`` option. [`#42`__ by Phred Lane] 272 | - Added ``color`` option. [`#43`__ by Phred Lane] 273 | 274 | __ https://github.com/junegunn/fzf/releases/tag/v0.60.3 275 | __ https://github.com/dahlia/iterfzf/pull/42 276 | __ https://github.com/dahlia/iterfzf/pull/43 277 | 278 | 279 | Version 1.5.0.60.2 280 | ~~~~~~~~~~~~~~~~~~ 281 | 282 | Released on March 5, 2025. Bundles ``fzf`` `0.60.2`__. 283 | 284 | - Added support for raising ``KeyboardInterrupt``. [`#40`__ by Phred Lane] 285 | - Officially support Python 3.13. 286 | 287 | __ https://github.com/junegunn/fzf/releases/tag/v0.60.2 288 | __ https://github.com/dahlia/iterfzf/pull/40 289 | 290 | 291 | Version 1.4.0.60.2 292 | ~~~~~~~~~~~~~~~~~~ 293 | 294 | Released on March 1, 2025. Bundles ``fzf`` `0.60.2`__. 295 | 296 | __ https://github.com/junegunn/fzf/releases/tag/v0.60.2 297 | 298 | 299 | Version 1.4.0.54.3 300 | ~~~~~~~~~~~~~~~~~~ 301 | 302 | Released on August 24, 2024. Bundles ``fzf`` `0.54.3`__. 303 | 304 | __ https://github.com/junegunn/fzf/releases/tag/v0.54.3 305 | 306 | 307 | Version 1.4.0.51.0 308 | ~~~~~~~~~~~~~~~~~~ 309 | 310 | Released on May 7, 2024. Bundles ``fzf`` `0.51.0`__. 311 | 312 | - Added ``bind`` option. [`#21`__, `#36`__ by Gregory.K] 313 | 314 | __ https://github.com/junegunn/fzf/releases/tag/0.51.0 315 | __ https://github.com/dahlia/iterfzf/issues/21 316 | __ https://github.com/dahlia/iterfzf/pull/36 317 | 318 | 319 | Version 1.3.0.51.0 320 | ~~~~~~~~~~~~~~~~~~ 321 | 322 | Released on May 6, 2024. Bundles ``fzf`` `0.51.0`__. 323 | 324 | - Added ``sort`` option. [`#18`__, `#35`__ by Gregory.K] 325 | - Officially support Python 3.12. 326 | 327 | __ https://github.com/junegunn/fzf/releases/tag/0.51.0 328 | __ https://github.com/dahlia/iterfzf/issues/18 329 | __ https://github.com/dahlia/iterfzf/pull/35 330 | 331 | 332 | Version 1.2.0.46.1 333 | ~~~~~~~~~~~~~~~~~~ 334 | 335 | Released on March 6, 2024. Bundles ``fzf`` `0.46.1`__. 336 | 337 | - Close stdin before waiting to allow ``--select-1`` to work. 338 | [`#34`__ by Alex Wood] 339 | 340 | __ https://github.com/junegunn/fzf/releases/tag/0.46.1 341 | __ https://github.com/dahlia/iterfzf/pull/34 342 | 343 | 344 | Version 1.1.0.44.0 345 | ~~~~~~~~~~~~~~~~~~ 346 | 347 | Released on November 18, 2023. Bundles ``fzf`` `0.44.0`__. 348 | 349 | - Added ``cycle`` option. [`#33`__ by Daniele Trifirò] 350 | - Added ``__extra__`` option. [`#32`__] 351 | 352 | __ https://github.com/junegunn/fzf/releases/tag/0.44.0 353 | __ https://github.com/dahlia/iterfzf/pull/33 354 | __ https://github.com/dahlia/iterfzf/issues/32 355 | 356 | 357 | Version 1.0.0.42.0 358 | ~~~~~~~~~~~~~~~~~~ 359 | 360 | Released on September 18, 2023. Bundles ``fzf`` `0.42.0`__. 361 | 362 | - Dropped Python 2.7, 3.5, 3.6, and 3.7 supports. 363 | - Officially support Python 3.8, 3.9, 3.10, and 3.11. 364 | - Dropped FreeBSD i386, Linux i686, Linux armv8l, OpenBSD i386, and Windows 365 | 32-bit supports as fzf no longer supports them. 366 | - Dropped OpenBSD amd64 support. 367 | - Except the first parameter ``iterable``, all parameters are enforced to be 368 | keyword-only. (Note that it's always been the recommended way to pass 369 | options, although it was not enforced.) 370 | - Added ``ansi`` option. [`#16`__ by Erik Lilja] 371 | - The ``executable`` parameter now takes ``os.PathLike`` instead of ``str``, 372 | which is backward compatible. 373 | - Added ``__version__`` and ``__fzf_version__`` attributes to the module. 374 | - Added ``POSIX_EXECUTABLE_NAME`` and ``WINDOWS_EXECUTABLE_NAME`` attributes 375 | to the module. 376 | - Module attribute ``EXECUTABLE_NAME`` is now a ``Literal['fzf', 'fzf.exe']`` 377 | type, which is backward compatible with the previous ``str`` type. 378 | - Module attribute ``BUNDLED_EXECUTABLE`` is now ``Optional[pathlib.Path]`` 379 | type. 380 | 381 | __ https://github.com/junegunn/fzf/releases/tag/0.42.0 382 | __ https://github.com/dahlia/iterfzf/pull/16 383 | 384 | 385 | Version 0.5.0.20.0 386 | ~~~~~~~~~~~~~~~~~~ 387 | 388 | Released on February 9, 2020. Bundles ``fzf`` 0.20.0. 389 | 390 | - Dropped Python 2.6, 3.3, and 3.4 supports. 391 | - Officially support Python 3.7 (it anyway had worked though). 392 | - Marked the package as supporting type checking by following `PEP 561`_. 393 | - Added ``preview`` option. [`#6`__ by Marc Weistroff] 394 | - Fixed a bug which had raised ``IOError`` by selecting an option before 395 | finished to load all options on Windows. [`#3`__ by Jeff Rimko] 396 | 397 | .. _PEP 561: https://www.python.org/dev/peps/pep-0561/ 398 | __ https://github.com/dahlia/iterfzf/pull/6 399 | __ https://github.com/dahlia/iterfzf/pull/3 400 | 401 | 402 | Version 0.4.0.17.3 403 | ~~~~~~~~~~~~~~~~~~ 404 | 405 | Released on December 4, 2017. Bundles ``fzf`` 0.17.3. 406 | 407 | 408 | Version 0.4.0.17.1 409 | ~~~~~~~~~~~~~~~~~~ 410 | 411 | Released on October 19, 2017. Bundles ``fzf`` 0.17.1. 412 | 413 | - Added missing binary wheels for macOS again. (These were missing from 414 | 0.3.0.17.1, the previous release.) 415 | 416 | 417 | Version 0.3.0.17.1 418 | ~~~~~~~~~~~~~~~~~~ 419 | 420 | Released on October 16, 2017. Bundles ``fzf`` 0.17.1. 421 | 422 | - Added ``print_query`` option. [`#1`__ by George Kettleborough] 423 | 424 | __ https://github.com/dahlia/iterfzf/pull/1 425 | 426 | 427 | Version 0.2.0.17.0 428 | ~~~~~~~~~~~~~~~~~~ 429 | 430 | Released on August 27, 2017. Bundles ``fzf`` 0.17.0. 431 | 432 | 433 | Version 0.2.0.16.11 434 | ~~~~~~~~~~~~~~~~~~~ 435 | 436 | Released on July 23, 2017. Bundles ``fzf`` 0.16.11. 437 | 438 | 439 | Version 0.2.0.16.10 440 | ~~~~~~~~~~~~~~~~~~~ 441 | 442 | Released on July 23, 2017. Bundles ``fzf`` 0.16.10. 443 | 444 | 445 | Version 0.2.0.16.8 446 | ~~~~~~~~~~~~~~~~~~ 447 | 448 | Released on June 6, 2017. Bundles ``fzf`` 0.16.8. 449 | 450 | - Upgraded ``fzf`` from 0.16.7 to 0.16.8. 451 | 452 | 453 | Version 0.2.0.16.7 454 | ~~~~~~~~~~~~~~~~~~ 455 | 456 | Released on May 20, 2017. Bundles ``fzf`` 0.16.7. 457 | 458 | - Made sdists (source distributions) possible to be correctly installed 459 | so that older ``pip``, can't deal with wheels, also can install ``iterfzf``. 460 | 461 | 462 | Version 0.1.0.16.7 463 | ~~~~~~~~~~~~~~~~~~ 464 | 465 | Released on May 19, 2017. Bundles ``fzf`` 0.16.7. The initial release. 466 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------