pydymenu


Namepydymenu JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/gikeymarcia/pydymenu
SummaryA pythonic wrapper interface for fzf, dmenu, and rofi.
upload_time2021-10-20 23:47:23
maintainer
docs_urlNone
authorMikey Garcia
requires_python
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
sudo apt install fzf rofi -y
```

### From [PyPi](https://pypi.org/project/pydymenu/)

```bash
pip3 install --user pydymenu
```

## Usage 

```python
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`](https://github.com/dahlia/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](https://github.com/gikeymarcia/pydymenu) and
[GitLab](https://gitlab.com/gikeymarcia/pydymenu). Each push to `master` 
automatically goes to both so choose whichever platform you prefer. All releases 
are uploaded to [PyPi](https://pypi.org/project/pydymenu/) 

Big thanks to [fzf](https://github.com/junegunn/fzf) and [Rofi](https://github.com/davatorium/rofi) developers for making the utilities this tool relies upon.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gikeymarcia/pydymenu",
    "name": "pydymenu",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mikey Garcia",
    "author_email": "gikeymarcia@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/19/22/c8f8dba147e81d1187cfd7ee0a5faedf65b668feb963e00e4924ad653ebe/pydymenu-0.5.2.tar.gz",
    "platform": "",
    "description": "# pydymenu: A Pythonic interface for `fzf` and `rofi`\n\nA single package to serve all your dynamic menu-ing needs with a simple Pythonic \ninterface.\n\n## Installation\n\n### Dependencies\n\n```bash\nsudo apt install fzf rofi -y\n```\n\n### From [PyPi](https://pypi.org/project/pydymenu/)\n\n```bash\npip3 install --user pydymenu\n```\n\n## Usage \n\n```python\nfrom pydymenu import fzf, rofi\n\npeople = [\"Joe\", \"Sam\", \"Daniel\", \"Bret\", \"Jordan\", \"Eric\", \"Lex\"]\n\n# fzf\ntalker = fzf(people, prompt=\"Pick a podcaster: \", preview=\"figlet {}\")\nif talker:\n    return talker[0]\n\n# rofi\ngui_select = rofi(people, prompt=\"Pick a podcaster: \", multi=True)\nif gui_select:\n    return gui_select[0]\n```\n\n`pydymenu.MENU(items: Iterable[str], **options) -> Optional[List[str]]`\n\n### Options\n\n`prompt: str`\n: The prompt text shown at the selection _(default: ` > `)_\n\n`multi: bool`\n: Whether or not to allow multiple selections. _(default: `multi=False`)_\n\n`case_sensitive: bool`\n: Whether or not to use case sensitive search _(default: `case_sensitive=False`)_\n\n`preview: str` **(fzf only)**\n: Command that will be run on each entry and displayed as it's preview when \nusing the fuzzy finder.\n\n## Project Status\n\nWorking support for the most common `fzf` and `rofi` use cases. Currently \nexpanding functionality for those two programs then going to move onto adding \n`dmenu` support.\n\nI'm trying to keep this package as a pretty simple drop-in replacement for \n[`iterfzf`](https://github.com/dahlia/iterfzf). Biggest design changes are:\n\n- `fzf` automatically sorts results based on match quality.\n- Selections always return lists of strings. When `multi=False` returns a list \n  of length 1.\n\n**Roadmap:**\n\n- Support for _dmenu_ systems\n\n### Source of Truth\n\nThis project is available on [GitHub](https://github.com/gikeymarcia/pydymenu) and\n[GitLab](https://gitlab.com/gikeymarcia/pydymenu). Each push to `master` \nautomatically goes to both so choose whichever platform you prefer. All releases \nare uploaded to [PyPi](https://pypi.org/project/pydymenu/) \n\nBig thanks to [fzf](https://github.com/junegunn/fzf) and [Rofi](https://github.com/davatorium/rofi) developers for making the utilities this tool relies upon.\n\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "A pythonic wrapper interface for fzf, dmenu, and rofi.",
    "version": "0.5.2",
    "project_urls": {
        "Homepage": "https://github.com/gikeymarcia/pydymenu"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fec7f61dc38a124c0b0f191159bea709eddcbebd2b3961171db5352517d4aedf",
                "md5": "d541a9a94c2ba80816b22926fc123047",
                "sha256": "86592c1221a01453a55e88376d5d6b3e0013c3e67c6484f31f3b9351de711a30"
            },
            "downloads": -1,
            "filename": "pydymenu-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d541a9a94c2ba80816b22926fc123047",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21652,
            "upload_time": "2021-10-20T23:47:21",
            "upload_time_iso_8601": "2021-10-20T23:47:21.512087Z",
            "url": "https://files.pythonhosted.org/packages/fe/c7/f61dc38a124c0b0f191159bea709eddcbebd2b3961171db5352517d4aedf/pydymenu-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1922c8f8dba147e81d1187cfd7ee0a5faedf65b668feb963e00e4924ad653ebe",
                "md5": "e71e8fde18b57e843eaf052b66d2d8ab",
                "sha256": "4c0afc0c3a0a959bb60d2024f67e59db0206df49b9eb66702040a97eba022cbe"
            },
            "downloads": -1,
            "filename": "pydymenu-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e71e8fde18b57e843eaf052b66d2d8ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20723,
            "upload_time": "2021-10-20T23:47:23",
            "upload_time_iso_8601": "2021-10-20T23:47:23.181201Z",
            "url": "https://files.pythonhosted.org/packages/19/22/c8f8dba147e81d1187cfd7ee0a5faedf65b668feb963e00e4924ad653ebe/pydymenu-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-10-20 23:47:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gikeymarcia",
    "github_project": "pydymenu",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pydymenu"
}
        
Elapsed time: 0.11558s