Skip to main content

A pure python implementation of fzf (fuzzyfinder) with some additional features using the curses library.

Project description

curses-fzf

codecov documentation PyPI

About

A pure Python implementation of fzf (fuzzyfinder) using the curses library - no external fzf binary required.

Although there are many good fzf libraries available, they all have one thing in common: They are wrappers to the shell tool fzf.

This is not inherently bad, but has one major downside: It does not integrate well into Python code.

  • What if you want to fuzzy-find over a list of dicts or objects?
  • What if you want to pre-select items (e.g. tags already set for a resource, that could be unset while selecting new ones)?
  • What if you want to display additional information along with the entry to fuzzy-find on?
  • What if you want to customize the fuzzy-finder algorithm?

To all of the above questions this module is the answer.

What can it do?

It provides a curses-based TUI for fuzzy-searching lists of any item type. Perfect for CLI tools needing interactive filtering of user options.

Image: simple elements with search query

It allows for single or multi select, preview functions, preselection of items and more. The module is designed to be highly customizable to fit your use-case: Provide your own scoring logic, remap keys or add your own functions to keybindings, change the color theme, ...

Image: multi select dicts with simple preview

It is easy and straight-forward to use:

from curses_fzf import FuzzyFinder, CursesFzfAborted

data = ["apple", "banana", "grape", "orange", "watermelon"]
fzf = FuzzyFinder(multi=True)
try:
    result = fzf.find(data)
except CursesFzfAborted:
    print("Fuzzy finder aborted by user.")
else:
    for item in result:
        print(item)

See documentation - basic usage for further details.

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

curses_fzf-0.2.5.tar.gz (108.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

curses_fzf-0.2.5-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file curses_fzf-0.2.5.tar.gz.

File metadata

  • Download URL: curses_fzf-0.2.5.tar.gz
  • Upload date:
  • Size: 108.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for curses_fzf-0.2.5.tar.gz
Algorithm Hash digest
SHA256 ca65b4b73512ff2393e6c1e25baa4c45fa14f12fe23ddc6db192e583e830c82c
MD5 f0b35e5f2bb5baa55a87af7bf3667e69
BLAKE2b-256 dacead6d66df31c0b92a0a5180a4c0fa7fe29476986325bdde6c03d4934d2d08

See more details on using hashes here.

Provenance

The following attestation bundles were made for curses_fzf-0.2.5.tar.gz:

Publisher: pypi-publish.yml on Heiko-san/curses_fzf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file curses_fzf-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: curses_fzf-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for curses_fzf-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0e4afcc0b38d5bc77b1113578a3540b5e6f75ac80fe80c27971d0d8ca0219aee
MD5 fbb70eac42b1f41408bf89c9511e4450
BLAKE2b-256 7205789f4702b38a13cf2770b564704d1cdff34e751f77ebfbb91b43bf04ae19

See more details on using hashes here.

Provenance

The following attestation bundles were made for curses_fzf-0.2.5-py3-none-any.whl:

Publisher: pypi-publish.yml on Heiko-san/curses_fzf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page