Skip to main content

Python Library and Command Line Tool for Fuzzy Selection.

Project description

MiniFzf GIF

Lightweight and efficient Python library inspired by the powerful features of fzf, the popular command-line fuzzy finder. minifzf is designed to bring the essential functionalities of fzf into your Python CLI projects with ease and simplicity.


Key Features:

  • Basic FZF Functionalities: Incorporates the fundamental features of fzf, offering efficient and fast fuzzy finding and selection capabilities right in your command line.
  • Library Use: Can be easily imported and used as a module in other Python projects, enhancing the interactive command-line interface experience.
  • Simplicity and Efficiency: Stripped down to core features, ensuring a lightweight and straightforward user experience without the overhead of complex functionalities.

Ideal Use Cases:

  • Interactive data selection and navigation in Python CLI applications.
  • Quick searching and filtering in command-line based tools or scripts.
  • Enhancing existing Python projects with simple, efficient selection capabilities.
  • Developers seeking a minimalistic yet powerful alternative to fzf for Python.

Installation:

pip install minifzf

CLI Usage:

$ mfzf --help

Usage: minifzf COMMAND [OPTIONS]

╭─ Commands ────────────────────────────────────────────╮
│ --help,-h     Display this message and exit.          │
│ --version,-v  Display application version.            │
╰───────────────────────────────────────────────────────╯
╭─ Parameters ──────────────────────────────────────────╮
│ --query  -q  Start the selector with the given query. │
│ --first  -1  Automatically select the only match.     │
╰───────────────────────────────────────────────────────╯

Start minifzf selection for current directory.

mfzf

With initial query.

minifzf -q "<Your Query>"

Returned most relevant item.

mfzf -q "<Your Query>" -1

Select from Standard Input.

No UNIX support for now (Throws [Errno 25] Inappropriate ioctl for device because minifzf uses sshkeyboard which utilizes termios library.)

cat filename | minifzf

Library Usage:

Initiating selector with headers and rows.

from minifzf import Selector
from pathlib import Path

selector = Selector(
    headers=['files'],
    rows=[[str(p)] for p in Path.cwd().glob('*')])
selected = selector.select()

Initating selector with mappings.

from minifzf import Selector

mappings = [
    {"id": "51009", "name": "Jujutsu Kaisen 2nd Season"},
    {"id": "40748", "name": "Jujutsu Kaisen"},
    {"id": "48561", "name": "Jujutsu Kaisen 0 Movie"}
]
selector = Selector.from_mappings(mappings=mappings)
selected = selector.select()

Initiating a path selector.

from minifzf import Selector
from pathlib import Path

path_selector = Selector.as_path_selector(
    directory=Path('path/to/directory'), recursive=False)
selected = path_selector.select()

Contribution and Feedback:

We welcome contributions and feedback to improve minifzf. If you have ideas, issues, or want to contribute, please feel free to open an issue or a pull request.

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

minifzf-0.1.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

minifzf-0.1.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file minifzf-0.1.3.tar.gz.

File metadata

  • Download URL: minifzf-0.1.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Windows/10

File hashes

Hashes for minifzf-0.1.3.tar.gz
Algorithm Hash digest
SHA256 10d64350f461886cc871e2c0c72366b8a630b04929a7b3bf78926d25d60d80b9
MD5 7251a7f7754cab2ec93760ef14a5fd16
BLAKE2b-256 e146b27e60d3183c1500c3bcc9e97123e6d2b5a093a1a23d1a9fa43f3abedcaa

See more details on using hashes here.

Provenance

File details

Details for the file minifzf-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: minifzf-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Windows/10

File hashes

Hashes for minifzf-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d8c36c28619e561a73f40023635b6f66a8b2a75c0b3968c220c7a968a088b22d
MD5 2d159be39e4a2f17a7eb697a519bb0c1
BLAKE2b-256 92bfdb3518eba848e7dcf302510fcfc29f9cc112295a57abc3bc9207d80d5b40

See more details on using hashes here.

Provenance

Supported by

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