{ "info": { "author": "Chris Penner", "author_email": "christopher.penner@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "# dont-argue\nDead-simple command line arguments for python scripts.\n\nI got sick of re-learning the argparse module every time I just needed to pass\nin a few simple command line arguments for a python script. `dont_argue` skips\nthe boring stuff and lets you get started in a flash.\n\n## Usage\n\n**dont\\_argue** provides the decorator **supply\\_args**, use it on a function\nand that function's arguments will be provided from the command line.\n\nCheck it out:\n```python\n#!/usr/bin/python\nfrom dont_argue import supply_args\n@supply_args\ndef main(name, location, *friends):\n friends = ', '.join(friends)\n print 'Hello {} from {} and your friends {}'.format(name, location, friends)\n\n# Now to kick things off we just call the function, the arguments come from the\n# command line, so we don't give any here.\nmain()\n```\n\nTry it out:\n```\n$ ./example.py Joe Alabama Jake Drake\nHello Joe from Alabama and your friends Jake, Drake\n```\nIf that's all you need, then you're done! Also notice how all the extra\narguments get packed up into `*friends` as expected.\n\nYou can also work with command line options by specifying keyword arguments for\nyour function. They can be specified on the command line using the\n`--option=value` or `--option value` syntax.\n```python\n@supply_args\ndef main(name, mood='FRIENDLY'):\n if mood == 'FRIENDLY':\n print 'Hello {}! Welcome here!'.format(name)\n elif mood == 'ANGRY':\n print 'Hey {}! Get out of my house!'.format(name)\nmain()\n```\n\nNow we can specify `mood` or not. Also note that providing too few arguments or\nusing the -h flag will display usage information.\n```\n$ ./test.py Joe\nHello Joe! Welcome here!\n$ ./example.py Joe --mood ANGRY\nHey Joe! Get out of my house!\n$ ./example.py -h\nusage: example.py [-h] [--mood MOOD] name\n\npositional arguments:\n name\n\noptional arguments:\n -h, --help show this help message and exit\n --mood MOOD\n```\n\nArbitrary keyword arguments don't make a ton of sense on the command line, so\nyou must explicitly declare your keyword arguments, `**kwargs` won't work with\ncommand line options.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ChrisPenner/dont-argue/releases/tag/v0.1.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChrisPenner/dont-argue", "keywords": "command line,argument,parsing,argparse", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dont-argue", "package_url": "https://pypi.org/project/dont-argue/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dont-argue/", "project_urls": { "Download": "https://github.com/ChrisPenner/dont-argue/releases/tag/v0.1.3", "Homepage": "https://github.com/ChrisPenner/dont-argue" }, "release_url": "https://pypi.org/project/dont-argue/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Dead-simple command line argument parsing", "version": "0.1.3" }, "last_serial": 1958483, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ce2ee2e3cd1e2d9816ef6cf1fb8de02e", "sha256": "2074f326afce7f6b81dc8b8008a120eb9fc6e5b1f3f6c95f80863b54c18e5087" }, "downloads": -1, "filename": "dont_argue-0.1.tar.gz", "has_sig": false, "md5_digest": "ce2ee2e3cd1e2d9816ef6cf1fb8de02e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2539, "upload_time": "2016-02-16T01:53:41", "url": "https://files.pythonhosted.org/packages/10/ea/4c47033db5dbb29808558e8827d9272cf8edde87f9afbb7f4cfbc821f258/dont_argue-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "81134f9439bd9b8fe6d4c6c8a6eb6a85", "sha256": "3812fc835f6a3b1d49b06c740840e93fa982b5c32f5e7b3a19d147dec4b1602c" }, "downloads": -1, "filename": "dont_argue-0.1.1.tar.gz", "has_sig": false, "md5_digest": "81134f9439bd9b8fe6d4c6c8a6eb6a85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2540, "upload_time": "2016-02-16T01:57:20", "url": "https://files.pythonhosted.org/packages/41/c0/e639fde227bfa5c3406fa6a46ee9900d894ed616bdf7b7a4aa83a009b813/dont_argue-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "460dc8e0b5f6f9e0ed6202ef974d830a", "sha256": "466fd3e55a93c85b15967ed4ca4fe3f40104e993725e6e87a6b0744b6da2c2ef" }, "downloads": -1, "filename": "dont_argue-0.1.2.tar.gz", "has_sig": false, "md5_digest": "460dc8e0b5f6f9e0ed6202ef974d830a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2540, "upload_time": "2016-02-16T02:15:23", "url": "https://files.pythonhosted.org/packages/4f/d4/8270d155a63017e6286e72ae3b82e0949725c0e366bc9e7ac41328c5578b/dont_argue-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "b0c4957fdcd98af8f733630f0b31ce1f", "sha256": "212e09a0cb89ffb5338dca5ec09f71e3ad501c9b676b1e5b4d7e032d5254a8ff" }, "downloads": -1, "filename": "dont_argue-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b0c4957fdcd98af8f733630f0b31ce1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3097, "upload_time": "2016-02-16T02:33:42", "url": "https://files.pythonhosted.org/packages/30/01/d4ae855b46a2be3f1daaf82be47e97e79b36b17fe6c72a35d5fbf01e9f5b/dont_argue-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b0c4957fdcd98af8f733630f0b31ce1f", "sha256": "212e09a0cb89ffb5338dca5ec09f71e3ad501c9b676b1e5b4d7e032d5254a8ff" }, "downloads": -1, "filename": "dont_argue-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b0c4957fdcd98af8f733630f0b31ce1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3097, "upload_time": "2016-02-16T02:33:42", "url": "https://files.pythonhosted.org/packages/30/01/d4ae855b46a2be3f1daaf82be47e97e79b36b17fe6c72a35d5fbf01e9f5b/dont_argue-0.1.3.tar.gz" } ] }