{ "info": { "author": "David Laban", "author_email": "alsuren@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: User Interfaces", "Topic :: Utilities" ], "description": "Command Line Interface Helper\n=================================\n\nThis is a helper module for making intuitive command line programs with \nzero effort. It takes a function signature like::\n\n example_function(string1, string2='something', string3='something else')\n\nand turns it into a simple command-line app with usage::\n\n example_program string1 [string2 [string3]]\n\nAll you have to do is::\n\n if __name__ == \"__main__\":\n import commandline\n commandline.run_as_main(example_function)\n\nLimitations\n============\n\nNote that it currently can't print help information for arguments other than \ntheir default values, but it will print your docstring for you if that's of \nany use.\n\nHelp for arguments will probably come with python3000's function annotations. \nhttp://www.python.org/dev/peps/pep-3107/\n\nArgument types are inferred from the default arguments. \nCurrently supported are: int, float, bool, str, commandline.Choice\n\nIf things don't have a default argument, I can't infer the type so assume str.\n\n\n\n >>> import commandline\n >>> commandline.TESTMODE=1\n >>> def test1(arg1=1, arg2=2, arg3=3):\n ... print [arg1, arg2, arg3]\n ...\n >>> commandline.run_as_main(test1, [])\n [1, 2, 3]\n >>> commandline.run_as_main(test1, ['6'])\n [6, 2, 3]\n >>> commandline.run_as_main(test1, ['--arg1=6', '--arg2=7', '--arg3=8'])\n [6, 7, 8]\n >>> commandline.run_as_main(test1, ['6', '7', '8'])\n [6, 7, 8]\n \n >>> commandline.run_as_main(test1, ['6', '7', '8', '9'], 'test.py')\n Usage: test.py [arg1 [arg2 [arg3]]] [Options]\n \n (Please put options last, and no more args than shown.)\n Unexpected argument(s): 9\n \n >>> commandline.run_as_main(test1, ['--arg1=6', '7', '8'], 'test.py')\n Usage: test.py [arg1 [arg2 [arg3]]] [Options]\n \n (Please put options last, and no more args than shown.)\n Unexpected argument(s): 7, 8\n \n >>> def test2(arg1=1, arg2=2, arg3=3):\n ... return [arg1, arg2, arg3]\n ...\n >>> commandline.run_as_main(test2, ['6', '7', '8'])\n [6, 7, 8]\n \n >>> def nodefault(arg1, arg2, arg3):\n ... return [arg1, arg2, arg3]\n >>> # If we have no default arguments, we assume you want strings:\n >>> commandline.run_as_main(nodefault, ['6', '7', '8'])\n ['6', '7', '8']\n >>> commandline.run_as_main(nodefault, [], 'test.py')\n Usage: test.py arg1 arg2 arg3 [Options]\n \n The following compulsory arguments are missing: arg1, arg2, arg3", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://alsuren.wordpress.com/tag/commandline/", "keywords": "command line commandline script", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "commandline", "package_url": "https://pypi.org/project/commandline/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/commandline/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://alsuren.wordpress.com/tag/commandline/" }, "release_url": "https://pypi.org/project/commandline/0.1.4dev/", "requires_dist": null, "requires_python": null, "summary": "Exposes your APIs to the command line.", "version": "0.1.4dev" }, "last_serial": 788320, "releases": { "0.1.2dev": [ { "comment_text": "built for Linux-2.6.28-11-generic-x86_64-with-glibc2.4", "digests": { "md5": "cf6af4d5c7a89d5df74469a370df508d", "sha256": "269a559d4ef8805ad5e3b5a1cd55e8a00f95c4be4b65671003b0f21c4d5289c1" }, "downloads": -1, "filename": "commandline-0.1.2dev.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "cf6af4d5c7a89d5df74469a370df508d", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 9232, "upload_time": "2009-06-12T13:35:06", "url": "https://files.pythonhosted.org/packages/18/16/737abfd73d5201b5db516830b3e0e0d7fc46a593959b45b0f9ac7b862c1d/commandline-0.1.2dev.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "1aa0a327d089ca10bc0d3179b7f65e4c", "sha256": "7535be4c75f45199fb7249e6a5899f2e8745fd463cc7bb4a66db7afe51a795f9" }, "downloads": -1, "filename": "commandline-0.1.2dev-py2.5.egg", "has_sig": false, "md5_digest": "1aa0a327d089ca10bc0d3179b7f65e4c", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 15724, "upload_time": "2009-06-12T13:36:29", "url": "https://files.pythonhosted.org/packages/56/d2/364d0cdc0dbe2d637596f248bb4cec45576573e9cc7dcf70364411ab2b86/commandline-0.1.2dev-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "e74b68d9b1e31620fbf872ed4cc37da9", "sha256": "dfc8ef849fba7a851f55e8d54222c949c1ce7da86412fb3a56978f04ebc40f2a" }, "downloads": -1, "filename": "commandline-0.1.2dev.tar.gz", "has_sig": false, "md5_digest": "e74b68d9b1e31620fbf872ed4cc37da9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5395, "upload_time": "2009-06-12T13:36:09", "url": "https://files.pythonhosted.org/packages/a1/c8/6e5d1a8e8f911e6b75c8158c56cca9c86c5bd9f142047a6bf7ba0946f778/commandline-0.1.2dev.tar.gz" } ], "0.1.3dev": [ { "comment_text": "", "digests": { "md5": "675720fc99ee631d4a595d6d0ff8d73f", "sha256": "c63848a69c7d4c4b4fc0b4a030fa62cf0256962922966e52fa970228f4d75319" }, "downloads": -1, "filename": "commandline-0.1.3dev-py2.6.egg", "has_sig": false, "md5_digest": "675720fc99ee631d4a595d6d0ff8d73f", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 13796, "upload_time": "2009-06-12T16:16:31", "url": "https://files.pythonhosted.org/packages/ce/e7/67722c4f224fab111d225a6ac546fcf5cb35b17d1182eebfc605a134b6c8/commandline-0.1.3dev-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "09b87e139794f9d94fc4cf0d13337c48", "sha256": "5880a51f10fc82e424fcd16fc5a97c5aedaa710237c2c4508b219d4fb7035f96" }, "downloads": -1, "filename": "commandline-0.1.3dev.tar.gz", "has_sig": false, "md5_digest": "09b87e139794f9d94fc4cf0d13337c48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5672, "upload_time": "2009-06-12T13:53:13", "url": "https://files.pythonhosted.org/packages/8b/fd/ac7a27d7f88d3de78d7a2aede15c2fa1dd6ce1be9ddac799263cbb4f85d9/commandline-0.1.3dev.tar.gz" } ], "0.1.4dev": [ { "comment_text": "", "digests": { "md5": "9f1ed5cb71f0dff21a02a8546abddd2c", "sha256": "b4118a1b9830359720d2282b687d912341d86668590caf06b90d2b984d090416" }, "downloads": -1, "filename": "commandline-0.1.4dev-py2.6.egg", "has_sig": false, "md5_digest": "9f1ed5cb71f0dff21a02a8546abddd2c", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 15052, "upload_time": "2009-06-13T17:00:12", "url": "https://files.pythonhosted.org/packages/a0/a8/d2701d2caeb5937ef4caa1cac6ab0d5efcf5404391a9d03b86a99700090b/commandline-0.1.4dev-py2.6.egg" } ], "0.1dev": [ { "comment_text": "", "digests": { "md5": "0137ec7b20bdabbdda7917c52b2b127a", "sha256": "915d81ec0207d49112f3b6dfdf6536c1f098b6a737b2129450a73bf293b15207" }, "downloads": -1, "filename": "commandline-0.1dev.tar.gz", "has_sig": false, "md5_digest": "0137ec7b20bdabbdda7917c52b2b127a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4464, "upload_time": "2009-06-11T14:23:35", "url": "https://files.pythonhosted.org/packages/41/c6/5a5ccf349a2afaf938c0dee7e7672a16f9dcc4ca156b110ffcf0aaff0031/commandline-0.1dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f1ed5cb71f0dff21a02a8546abddd2c", "sha256": "b4118a1b9830359720d2282b687d912341d86668590caf06b90d2b984d090416" }, "downloads": -1, "filename": "commandline-0.1.4dev-py2.6.egg", "has_sig": false, "md5_digest": "9f1ed5cb71f0dff21a02a8546abddd2c", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 15052, "upload_time": "2009-06-13T17:00:12", "url": "https://files.pythonhosted.org/packages/a0/a8/d2701d2caeb5937ef4caa1cac6ab0d5efcf5404391a9d03b86a99700090b/commandline-0.1.4dev-py2.6.egg" } ] }