{ "info": { "author": "Steven Willis", "author_email": "onlynone@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "===============================\nSystem Commands\n===============================\n\n.. image:: https://img.shields.io/pypi/v/pysyscmd.svg\n :target: https://pypi.python.org/pypi/pysyscmd\n\n\nUtility to call any system command from python.\n\nImport any program that's on your PATH from ``syscmd.cmds`` and you'll get a\nfunction that executes the program with the given positional arguments. By,\ndefault, the function uses ``subprocess.check_call`` to execute the program. But\nthis can be changed by passing in one of ``syscmd.CALL``, ``syscmd.CHECK_CALL``,\nor ``syscmd.CHECK_OUTPUT`` as the ``f`` argument to your function to get the\nrespective ``subprocess`` function. Expect the same behavior from the imported\n``syscmd`` functions as the ``subprocess`` functions, eg. return value, standard\nin/out/error, etc.\n\nIn addition to the positional arguments and ``f``, the imported functions also\naccept all the keyword arguments of the underlying ``subprocess`` functions.\n\nExamples::\n\n # Import various system commands\n >>> from syscmd.cmds import echo, ls, true, false\n\n # Run 'echo' with three positional arguments; stdout goes to stdout and the\n # exit code is returned\n >>> res = echo('one', 'two', 'three')\n one two three\n >>> print res\n 0\n\n # Run 'ls' with no arguments\n >>> res = ls()\n AUTHORS.rst MANIFEST.in setup.cfg\n CONTRIBUTING.rst README.rst setup.py\n HISTORY.rst docs syscmd\n LICENSE requirements.txt tox.ini\n\n # Run 'ls' with the '-l' option on 'README.rst'\n >>> res = ls('-l', 'README.rst')\n -rw-r--r-- 1 swillis staff 1904 Apr 21 13:13 README.rst\n\n # Run 'true'\n >>> res = true()\n >>> print res\n 0\n\n # Run 'false'\n >>> res = false()\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"syscmd/cmds.py\", line 57, in _cmd\n return f(full_args, **full_kwargs)\n File \"/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py\", line 540, in check_call\n raise CalledProcessError(retcode, cmd)\n subprocess.CalledProcessError: Command '('/usr/bin/false',)' returned non-zero exit status 1\n\n # Uh-oh... a non-zero exit code raises an exception because it's run with\n # 'subprocess.check_call'\n\n # Import CALL from syscmd\n >>> from syscmd import CALL\n >>> res = false(f=CALL)\n\n # Now running 'false' doesn't cause an exception, but we still get the exit\n # code as the return value\n >>> print res\n 1\n\n* Free software: BSD license\n\nFeatures\n--------\n\n* TODO\n\n\n\n\nHistory\n-------\n\n1.0.0 (2015-10-28)\n------------------\n\n* Documentation updates\n* Code is stable, no reason not to be at a 1.0.0 release\n\n0.1.0 (2015-01-11)\n---------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/onlynone/pysyscmd", "keywords": "syscmd", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pysyscmd", "package_url": "https://pypi.org/project/pysyscmd/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pysyscmd/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/onlynone/pysyscmd" }, "release_url": "https://pypi.org/project/pysyscmd/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Utility to call system commands from python", "version": "1.0.0" }, "last_serial": 1790640, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "280796f84bd429bcc82cf710b1792e5e", "sha256": "c7818e2c3a52253913a157daf1c4e7e90d10cd291f9a98815ac9083816d68dd3" }, "downloads": -1, "filename": "pysyscmd-0.1.0-py2.7.egg", "has_sig": false, "md5_digest": "280796f84bd429bcc82cf710b1792e5e", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 5210, "upload_time": "2015-04-21T17:05:51", "url": "https://files.pythonhosted.org/packages/79/34/33ad352a31a2af47df83963de2810b2b2ecca326ed21927b360832daddcc/pysyscmd-0.1.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "eaba0f0b335c82e3117624aeb6195acf", "sha256": "93f3c53387f1c2372071837950eadd2309672d0a894923d45219bd288af58a36" }, "downloads": -1, "filename": "pysyscmd-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eaba0f0b335c82e3117624aeb6195acf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5053, "upload_time": "2015-04-21T17:05:55", "url": "https://files.pythonhosted.org/packages/72/fd/4535c1bd449fcf0e47c086ad392221fe19dc359d8b2f1513d4ea0f85f8da/pysyscmd-0.1.0-py2.py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "dfe2403f81203c7b03e250bfa6cc5389", "sha256": "90e7b55e7efe79a9f9e07a202543a5162628608a560102b61993eae5f87be8a5" }, "downloads": -1, "filename": "pysyscmd-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dfe2403f81203c7b03e250bfa6cc5389", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12321, "upload_time": "2015-10-28T19:15:44", "url": "https://files.pythonhosted.org/packages/2a/ac/0a5cd51901b6f4960c503ce0acc0348efe054c97812a6aa09ea1c0ba277c/pysyscmd-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dfe2403f81203c7b03e250bfa6cc5389", "sha256": "90e7b55e7efe79a9f9e07a202543a5162628608a560102b61993eae5f87be8a5" }, "downloads": -1, "filename": "pysyscmd-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dfe2403f81203c7b03e250bfa6cc5389", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12321, "upload_time": "2015-10-28T19:15:44", "url": "https://files.pythonhosted.org/packages/2a/ac/0a5cd51901b6f4960c503ce0acc0348efe054c97812a6aa09ea1c0ba277c/pysyscmd-1.0.0.tar.gz" } ] }