Skip to main content

pydymenu: A Pythonic interface for fzf and rofi

A single package to serve all your dynamic menu-ing needs with a simple Pythonic interface.

Installation

Dependencies

sudo apt install fzf rofi -y

From PyPi

pip3 install --user pydymenu

Usage

from pydymenu import fzf, rofi

people = ["Joe", "Sam", "Daniel", "Bret", "Jordan", "Eric", "Lex"]

# fzf
talker = fzf(people, prompt="Pick a podcaster: ", preview="figlet {}")
if talker:
    return talker[0]

# rofi
gui_select = rofi(people, prompt="Pick a podcaster: ", multi=True)
if gui_select:
    return gui_select[0]

pydymenu.MENU(items: Iterable[str], **options) -> Optional[List[str]]

Options

prompt: str : The prompt text shown at the selection (default: >)

multi: bool : Whether or not to allow multiple selections. (default: multi=False)

case_sensitive: bool : Whether or not to use case sensitive search (default: case_sensitive=False)

preview: str (fzf only) : Command that will be run on each entry and displayed as it's preview when using the fuzzy finder.

Project Status

Working support for the most common fzf and rofi use cases. Currently expanding functionality for those two programs then going to move onto adding dmenu support.

I'm trying to keep this package as a pretty simple drop-in replacement for iterfzf. Biggest design changes are:

  • fzf automatically sorts results based on match quality.
  • Selections always return lists of strings. When multi=False returns a list of length 1.

Roadmap:

  • Support for dmenu systems

Source of Truth

This project is available on GitHub and GitLab. Each push to master automatically goes to both so choose whichever platform you prefer. All releases are uploaded to PyPi

Big thanks to fzf and Rofi developers for making the utilities this tool relies upon.

Metadata

Release files for pydymenu 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydymenu 0.5.2
File Size Uploaded
pydymenu-0.5.2.tar.gz 20.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydymenu 0.5.2
File Interpreter ABI Platform
pydymenu-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.4 kB

Release files / pydymenu-0.5.2.tar.gz

Download URL pydymenu-0.5.2.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4c0afc0c3a0a959bb60d2024f67e59db0206df49b9eb66702040a97eba022cbe
BLAKE2b-256 checksum
How to use checksums
1922c8f8dba147e81d1187cfd7ee0a5faedf65b668feb963e00e4924ad653ebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

Release files / pydymenu-0.5.2-py3-none-any.whl

Download URL pydymenu-0.5.2-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86592c1221a01453a55e88376d5d6b3e0013c3e67c6484f31f3b9351de711a30
BLAKE2b-256 checksum
How to use checksums
fec7f61dc38a124c0b0f191159bea709eddcbebd2b3961171db5352517d4aedf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page