{ "info": { "author": "David Taylor", "author_email": "prooffreader@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "pytabby\n================\n\n.. inclusion-marker-top-of-index\n\n.. image:: https://secure.travis-ci.org/Prooffreader/pytabby.png\n :target: http://travis-ci.org/Prooffreader/pytabby\n\n.. image:: https://ci.appveyor.com/api/projects/status/preqq0h4peiad07a?svg=true\n :target: https://ci.appveyor.com/project/Prooffreader/pytabby\n\n.. image:: https://codecov.io/gh/Prooffreader/pytabby/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/Prooffreader/pytabby\n\n.. image:: https://api.codacy.com/project/badge/Grade/dae598fbe5b04b0e90e9e2080bb68c11\n :target: https://www.codacy.com/app/Prooffreader/pytabby?utm_source=github.com&utm_medium=referral&utm_content=Prooffreader/pytabby&utm_campaign=Badge_Grade)\n\n.. image:: https://camo.githubusercontent.com/14a9abb7e83098f2949f26d2190e04fb1bd52c06/68747470733a2f2f626c61636b2e72656164746865646f63732e696f2f656e2f737461626c652f5f7374617469632f6c6963656e73652e737667\n :target: https://github.com/Prooffreader/pytabby/blob/master/LICENSE\n\n.. image:: https://camo.githubusercontent.com/28a51fe3a2c05048d8ca8ecd039d6b1619037326/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667\n :target: https://github.com/ambv/black\n\n.. image:: https://img.shields.io/badge/python-3.6%7C3.7-blue.svg\n :target: https://www.python.org/\n\n.. image:: https://img.shields.io/badge/platform-linux--64%7Cwin--32%7Cwin--64-lightgrey.svg\n :target: https://github.com/Prooffreader/pytabby\n\n.. image:: https://badge.fury.io/py/pytabby.svg\n :target: https://pypi.org/project/pytabby\n\nA *flexible, non-opinionated*, **tabbed** menu system to interactively control program flow for\nterminal-based programs. It's a class with one sole public method which runs in a ``while``\nloop as you switch tabs (if you want tabs, that is; you're free not to have any) or if you \nenter invalid input, and then returns a string based on the value you selected that\nyou can use to control the outer program flow.\n\nOf course, you can run the class itself in a ``while`` loop in the enclosing program, getting\nmenu choice after menu choice returned as you navigate a program.\n\n\nInstallation\n------------\n\n``pip install pytabby``\n\nMeow.\n\n\nUsage\n-----\n\n.. code-block:: python\n\n from pytabby import Menu\n myconfig = Menu.safe_read_yaml('path/to/yaml')\n # or Menu.read_json() or just pass a dict in the next step\n mymenu = Menu(myconfig)\n result = mymenu.run()\n\n if result == 'result1':\n do_this_interesting_thing()\n elif result == 'result2':\n do_this_other_thing()\n # etc...\n\n\nSee it in action!\n-----------------\n\n.. image:: https://www.dtdata.io/shared/pytabby.gif\n\nFAQ\n---\n\n***Why did you make this?**\n Well, it was one of those typical GitHub/PyPI scenarios, I wanted a specific thing,\n so I made a specific thing and then I took >10X the time making it a project so that\n others can use the thing; maybe some people will find it useful, maybe not.\n I like running programs in the terminal, and this allowed me to put a bunch of\n utilities like duplicate file finders and bulk file renamers all under one\n umbrella. If you prefer GUIs, there are plenty of simple wrappers out there,\n\n**Why can't I return handlers?**\n Out of scope for this project at this time, but it's on the\n Wish List. For now, the Menu instance just returns strings \n which the outer closure can then use to control program flow,\n including defining handlers using control flow/if statement\n based on the string returned by Menu.run().\n\n**Why are my return values coming in/out strings?**\n To keep things simple, all input and output (return) values are\n converted to string. So if you have\n ``config['tabs'][0]['items][0]['item_returns'] = 1``,\n the return value will be '1'.\n\n**Why do 'items' have both 'item_choice_displayed' and 'item_inputs' keys?**\n To keep things flexible, you don't have to display exactly\n what you'll accept as input. For example, you could display\n 'yes/no' as the suggested answers to a yes or no question, but\n actually accept ['y', 'n', 'yes', 'no'], etc.\n\n**I have 'case_sensitive' = False, but my return value is still uppercase.**\n ``case_sensitive`` only affects inputs, not outputs\n\n**What's up with passing a dict with the tab name as a message to Menu.run()?**\n The message might be different depending on the tab, and ``run()`` \n only exits when it returns a value when given a valid item input.\n It changes tabs in a loop, keeping that implementation detail \n abstracted away from the user, as is right.\n\n\nDependencies\n------------\n\n* ``PyYAML>=5.1``\n* ``schema>=0.7.0``\n\n.. inclusion-marker-before-wishlist\n\nWish List:\n----------\n\n.. inclusion-marker-start-wishlist\n\n* a way to dynamically silence (\"grey out\", if this were a GUI menu system)\n certain menu items, which may be desired during program flow, probably by\n passing a list of silenced tab names and return values\n* have an option to accept single keypresses instead of multiple keys and\n ENTER with the input() function, using ``msvcrt`` package in Windows\n or ``tty`` and ``termios`` in Mac/Linux. (This will make coverage platform-\n dependent, so it will have to be cumulative on travis and appveyor)\n\n.. inclusion-marker-stop-wishlist\n\nPhoto Credit\n------------\n\n`Erik-Jan Leusink via Unsplash `_", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/Prooffreader/pytabby/archive/v0.1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/Prooffreader/pytabby", "keywords": "python,shell,terminal,console,tabs,tabbed,menu,menus", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytabby", "package_url": "https://pypi.org/project/pytabby/", "platform": "", "project_url": "https://pypi.org/project/pytabby/", "project_urls": { "Download": "https://github.com/Prooffreader/pytabby/archive/v0.1.0.tar.gz", "Homepage": "http://github.com/Prooffreader/pytabby" }, "release_url": "https://pypi.org/project/pytabby/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A simple, non-opinionated python terminal menu system WITH TABS", "version": "0.1.0" }, "last_serial": 5190076, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e2f7fc7369a472bbb36a57f15ccf7802", "sha256": "f840a2c15f67ad16eb97fea7a50d179fc659e7b8eea67ecb9aae8607dc242ce0" }, "downloads": -1, "filename": "pytabby-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e2f7fc7369a472bbb36a57f15ccf7802", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17237, "upload_time": "2019-04-25T22:59:11", "url": "https://files.pythonhosted.org/packages/9a/b8/324033ea3c3ff54dea786227c9c7a50a0851d8d2e261809f6d24a70ab7f0/pytabby-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e2f7fc7369a472bbb36a57f15ccf7802", "sha256": "f840a2c15f67ad16eb97fea7a50d179fc659e7b8eea67ecb9aae8607dc242ce0" }, "downloads": -1, "filename": "pytabby-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e2f7fc7369a472bbb36a57f15ccf7802", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17237, "upload_time": "2019-04-25T22:59:11", "url": "https://files.pythonhosted.org/packages/9a/b8/324033ea3c3ff54dea786227c9c7a50a0851d8d2e261809f6d24a70ab7f0/pytabby-0.1.0.tar.gz" } ] }