{ "info": { "author": "Paul-Michael Agapow", "author_email": "pma@agapow.net", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: User Interfaces" ], "description": "===========\nAbout qanda\n===========\n\nBackground\n----------\n\nInteractive command-line programs need to query users for information, be it\ntext, choices from a list, or simple yes-or-no answers. *qanda* is a Python\nmodule of simple functions to prompt users for such information, allowing\nvalidation and cleanup of answers, default responses, consistent formatting and\npresentation of help text, hints and choices. It is not a replacement for\ntextual interfaces like curses and urwid, but intended solely for simple console\nscripts with user input is required.\n\n\nInstallation\n------------\n\nThe simplest way to install *qanda* is via ``easy_install`` or an equivalent\nprogram::\n\n\t% easy_install qanda\n\nAlternatively the tarball can be downloaded, unpacked and ``setup.py`` run::\n\n\t% tar zxvf qanda.tgz\n\t% cd qanda\n\t% python set.py install\n\n*qanda* has no requisites and should work with just about any version of Python.\n\n\nUsing qanda\n-----------\n\nExamples\n~~~~~~~~\n\n::\n\n\t>>> from qanda import prompt\n\t>>> prompt.string (\"What is your name\")\n\tWhat is your name: Foo\n\t>>> fname = prompt.string (\"Your friends name is\",\n\t\t\thelp=\"I need to know your friends name as well before I talk to you.\",\n\t\t\thints=\"first name\",\n\t\t\tdefault='Bar',\n\t\t)\n\t\n\tI need to know your friends name as well before I talk to you.\n\tYour friends name is (first name) [Bar]:\n\t>>> print fname\n\tBar\n\t>>> years = prompt.integer (\"And what is your age\", min=1, max=100)\n\tAnd what is your age: 101\n\tA problem: 101 is higher than 100. Try again ...\n\tAnd what is your age: 28\n\n\n\nCentral concepts\n~~~~~~~~~~~~~~~~\n\n*qanda* packages all question-asking methods in a Session class. This allows\nthe appearance and functioning of all these methods to be handled consistently\nand modified centrally. However, you don't necessarily have to create a Session\nto use it - there's pre-existing Session in the variable called ``prompt``::\n\n\t>>> from qanda import Session\n\t>>> s = Session()\n\t>>> from qanda import prompt\n\t>>> type (prompt)\n\t\n\nThe question methods are named after the type of data they elicit::\n\n\t>>> print type(prompt.integer (\"Pick a number\"))\n\tPick a number: 2\n\t\n\t>>> print type(prompt.string (\"Pick a name\"))\n\tPick a name: Bob\n\t\n\nMany of the question methods with accept a list of \"converters\", each of which\nis used to sucessively transform or validate user input. If input fails\nvalidation, the question is posed again. *qanda* supplies a number of basic\nvalidators:\n\nToInt, ToFloat\n\tConvert inputs to other types\nRegex\n\tnly allow values that match a certain pattern\nRange\n\tCheck that input falls within given bounds\t\nLength\n\tCheck that input length falls within given bounds\nSynonyms\n\tMap values to other values\nVocab\n\tEnsure values fall within a fixed set\n\n\nReferences\n----------\n\n.. [qanda-home] qanda home page http://www.agapow.net/software/py-qanda\n\n.. [qanda-pypi] qanda on PyPi\n\n\n\nHistory\r\n-------\r\n\r\nv0.1dev (20110624)\r\n~~~~~~~~~~~~~~~~~~\r\n\r\n* Initial release, sure to be buggy and incomplete", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.agapow.net/software/py-qanda", "keywords": "text commandline ui prompt", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "qanda", "package_url": "https://pypi.org/project/qanda/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/qanda/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.agapow.net/software/py-qanda" }, "release_url": "https://pypi.org/project/qanda/0.1dev/", "requires_dist": null, "requires_python": null, "summary": "Simple text prompts and validation for user input", "version": "0.1dev" }, "last_serial": 798303, "releases": { "0.1dev": [ { "comment_text": "", "digests": { "md5": "26ebeda5ba45d953777533dadfd31923", "sha256": "77c8f597f5b69c79810630ff87e282988e98f08ac0b070f192e376d57f7f23e6" }, "downloads": -1, "filename": "qanda-0.1dev.tar.gz", "has_sig": false, "md5_digest": "26ebeda5ba45d953777533dadfd31923", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61913, "upload_time": "2011-07-18T16:10:20", "url": "https://files.pythonhosted.org/packages/05/1a/3e44f9eff0ee4ccf76ba97124fb4d98d6648a4af2b74d281f06955c1111e/qanda-0.1dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26ebeda5ba45d953777533dadfd31923", "sha256": "77c8f597f5b69c79810630ff87e282988e98f08ac0b070f192e376d57f7f23e6" }, "downloads": -1, "filename": "qanda-0.1dev.tar.gz", "has_sig": false, "md5_digest": "26ebeda5ba45d953777533dadfd31923", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61913, "upload_time": "2011-07-18T16:10:20", "url": "https://files.pythonhosted.org/packages/05/1a/3e44f9eff0ee4ccf76ba97124fb4d98d6648a4af2b74d281f06955c1111e/qanda-0.1dev.tar.gz" } ] }