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.3.0.tar.gz (110.1 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.3.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: curses_fzf-0.3.0.tar.gz
  • Upload date:
  • Size: 110.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 64f076dc421cb2be417c67e6e5e2fde864ebc8424db8c90c5f45045ff2d9202c
MD5 ff64c06d969e4965b7ec48cbdc5f1f2a
BLAKE2b-256 4c73ae166e2061990c8a0411c296e388862e152b7ee359d70ffbffb4329c2054

See more details on using hashes here.

Provenance

The following attestation bundles were made for curses_fzf-0.3.0.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: curses_fzf-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cddb8b9fd543b62d3f1f5b790691926a4d0117b46d117e89dc639ff6d4bb8c93
MD5 2b31a34d4c29f4e1b22d252736aca34f
BLAKE2b-256 8b897b6b5ad0efc766773e6a26136da0cf49c58fc2b0dc00f65a732a4b8f0940

See more details on using hashes here.

Provenance

The following attestation bundles were made for curses_fzf-0.3.0-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