{ "info": { "author": "Aaron Christianson", "author_email": "ninjaaron@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.5" ], "description": "*easyproc* is based on the ``suprocess.run()`` function in Python 3.5 (a\nfair amount of the code is copied directly from the module). It provides\nbasically the same interface, plus a couple of convenience features and\nfunctions to simplify administrative scripting a bit. It addresses what\nI perceive to be three shortcomings in the Popen API (in order of\negregiousness)\n\n1. Input and output streams default to bytes. This is manifestly\n ridiculous in Python 3. easyproc turns on *universal_newlines*\n everywhere, so you don't have to worry about decoding bytes.\n2. Piping a chain of processes together is not particularly intuitive\n and takes a lot of extra work when not using shell=True.\n ``easyproc.pipe()`` provides a simple way to pipe a chain of shell\n commands into each other without the safety risk of granting a shell.\n Admittedly, if one is piping together a lot of shell commands, one\n might wonder why bother with python at all? Or better, why not use\n native python filters? Certainly, that is the preferable option in\n situations were \"shelling out\" creates a performance bottle-neck, but\n there are times where the performance cost is small, and, in terms of\n development speed, shell utilities are often ideally suited to\n parsing the output of shell commands. Easy things should be easy,\n right?\n3. While not particularly egregious, and sometimes even useful, it can\n be annoying to split each command argument into a separate list item.\n easyproc commands can be strings or lists. If it's a string, it's run\n through ``shlex.split()`` prior to being passed to\n ``subprocess.run()``.\n\nAdditionally, easyproc defaults to error checking. As per *The Zen of\nPython*, \"Errors should never pass silently -- unless explicitly\nsilenced.\" easyproc follows this logic.\n\n*easyproc* does not replace all the functionality of the subprocess\nmodule by a long shot, but it does try to expose much of it by passing\nadditional kwargs to ``subprocess.run()``, so many advanced use-cases\nshould be possible, and one need only refer to the documentation for the\nsubprocess module.\n\n*easyproc* provides four simple functions for messing with shell\ncommands. ``easyproc.run()`` simply runs the command you give it through\n``shlex.split()`` if it is a string, and then sends it to\n``suprocess.run()`` with *universal_newlines* turned on, and all\nadditional kwargs passed along to Popen. As with ``subprocess.run()`` it\nreturns as ``CompletedProcess`` instance. The only difference is that\nstdout and stderr attributes are ProcStream instances (see below)\ninstead of byte-strings. Note that the \"timeout\" parameters is broken in\npython 2.\n\n``easyproc.Popen()`` also turns on unicode and automatically splits\ncommand strings, but it returns a Popen instance, in case you need to\ninteract with a running process (Note: the Popen object will require\nexplicit error checking because it represents a process in progress and\ndoesn't have a return code until additional methods are called on it).\n\n``easyproc.grab()`` is like ``easyproc.run()``, but it captures the\nstdout of the command without the bother of having to type\n``stdout=easyproc.PIPE`` and ``.stdout``. The stream option, which\ndefaults to 1, choses whether to grab stdin (1), stdout (2) or both\ntogether (1+2). (same as ``stderr=easyproc.STDIN``.) ``easyproc.grab()``\nis also a bit lazy. The process isn't actually run until you try to do\nsomething with the output.\n\n\n``easyproc.pipe()`` takes any number of commands as args and pipes them\ninto each other in the order they are given. The output is captured as\nwith ``easyproc.grab()``, unless otherwise specified. if you plan on\npassing a lot of subprocess.run/Popen parameters to easyproc.pipe, you\nmay want to look at the doc string to see what it will do.\n\n*easyproc* also provides the three special variables from the subprocess\nmodule, ``PIPE``, ``STDOUT``, and ``DEVNULL``, for those who know and\ncare what they do.\n\nWhile the ``input`` parameter for easyproc functions is inherited\ndirectly from ``suprocess.run()``, it may be useful for those avoiding\nthe subprocess docs to here note that this parameter is used to pass\ntext to the STDIN of a command (and doesn't require the use of\nstdin=PIPE); i.e. it's like ``echo \"text\"|command``. In suprocess, the\ntext must be bytes by default. In easyproc, as with all other streams,\nit ought to be a string.\n\nAll streams returned by functions in this module (i.e. stdout and\nstderr), excluding Popen, are ``ProcOutput`` objects. These are\nsubclasses of ``str``, but they act like a tuple of (stripped) lines\nwhen you do sequence operations on them, since most shell commands\nproduce output which is intended to be read line by line. Basically, the\nwhole reason this module exists is because I got tired of writing\n``subprocess.check_output(['cmd', 'and',\n'args']).decode().splitines()``. Now, I just write ``easyproc.grab('cmd\nand args')``.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ninjaaron/easyproc", "keywords": "shell pipe subprcess process scripting", "license": "", "maintainer": "", "maintainer_email": "", "name": "easyproc", "package_url": "https://pypi.org/project/easyproc/", "platform": "", "project_url": "https://pypi.org/project/easyproc/", "project_urls": { "Homepage": "https://github.com/ninjaaron/easyproc" }, "release_url": "https://pypi.org/project/easyproc/0.5.1/", "requires_dist": null, "requires_python": "", "summary": "thin abstraction on subprocess.run to simplify admin scripts", "version": "0.5.1" }, "last_serial": 3705962, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3051fbd42e7b3b8f7f37c73919e6ff98", "sha256": "01b18d2ac5b713100ede41d049ad123271dd3f0a9ba8034817afec139406b965" }, "downloads": -1, "filename": "easyproc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3051fbd42e7b3b8f7f37c73919e6ff98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 769, "upload_time": "2016-03-15T07:57:32", "url": "https://files.pythonhosted.org/packages/11/9a/aa7eafca44c8aa53bc5b1e3926673a1d9a2f9eaa7b7f69acb0e9fefe05f6/easyproc-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e5d32daf670b625fc5124fa29a48f4d6", "sha256": "6f82993fbf843d8cd03e32cbd6190d687a5bef46ed6c5b4d4695edb777115335" }, "downloads": -1, "filename": "easyproc-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e5d32daf670b625fc5124fa29a48f4d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3542, "upload_time": "2016-03-15T09:43:34", "url": "https://files.pythonhosted.org/packages/ae/cf/ef6b2e9e2980aae765b6a5fc17f6b7817c130ded8590054f936e9bd66550/easyproc-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "894f5427c321933f298093939005ab26", "sha256": "3aa9d7d806bf943095da651e553ee8ed4d7d9dfcd5546ced59f033ce3b6eea86" }, "downloads": -1, "filename": "easyproc-0.2.0.tar.gz", "has_sig": false, "md5_digest": "894f5427c321933f298093939005ab26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3896, "upload_time": "2016-05-10T18:43:08", "url": "https://files.pythonhosted.org/packages/4d/6e/92dcc1d13ab45b3c81dffa3c72462e4a9c1cbd2fed68475ee9a4a73ff17d/easyproc-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "82a28c35b0f4f179ee0f399b2b8efff4", "sha256": "2cc7fb7b4896090cebb992fe179752bc381dbd18981458659c2790fd2a2f50ca" }, "downloads": -1, "filename": "easyproc-0.3.0.tar.gz", "has_sig": false, "md5_digest": "82a28c35b0f4f179ee0f399b2b8efff4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5889, "upload_time": "2016-07-10T19:20:18", "url": "https://files.pythonhosted.org/packages/59/2e/4f89fad74e53aee1097639979dc82e7ca8a82924fa24059ebdcc7dbd2195/easyproc-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "d357678190415fb698081537ed0cfdf1", "sha256": "6d9da74c35a53222bb4522ea0439923be91401aa3a66fb39fd618b39c20eedfb" }, "downloads": -1, "filename": "easyproc-0.3.1.tar.gz", "has_sig": false, "md5_digest": "d357678190415fb698081537ed0cfdf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5853, "upload_time": "2016-07-13T04:46:50", "url": "https://files.pythonhosted.org/packages/33/64/33e912eb62ebdbf450738670b8de870d1ed36e7bf44738b4d84a3d2490ef/easyproc-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "1687947a361e159e120fd09a1e791a7f", "sha256": "bd138987b9c6c038d820da5649ddaacacfb5fa8e2fa30242d928cd5ab3694aeb" }, "downloads": -1, "filename": "easyproc-0.3.2.tar.gz", "has_sig": false, "md5_digest": "1687947a361e159e120fd09a1e791a7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5886, "upload_time": "2016-07-18T19:42:30", "url": "https://files.pythonhosted.org/packages/c1/2e/5b2a401b5af9f14704445185c5295d60867d918ffb5021404528ab59d26f/easyproc-0.3.2.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "2fb8c12ae77d367530976383c800d711", "sha256": "386ccb4cf29d1a6149c4b7a70527a59c09a8f681070849e16a65c741f4405fc6" }, "downloads": -1, "filename": "easyproc-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2fb8c12ae77d367530976383c800d711", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9630, "upload_time": "2016-08-12T22:26:36", "url": "https://files.pythonhosted.org/packages/27/c9/a9de7c7a998f11171623eb401858a7e530eba144d6057cd561ac49858ea6/easyproc-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81303e1390052d6be8b23a419ffab404", "sha256": "12efe1d689b2751edaab62c680e374f265059078fa85d5f2351ecbfa17a5eac2" }, "downloads": -1, "filename": "easyproc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "81303e1390052d6be8b23a419ffab404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6564, "upload_time": "2016-08-12T22:26:39", "url": "https://files.pythonhosted.org/packages/8c/1b/52bdf404012ab7bdae3b6481ef8962d3c39ad4be2e798c710f85f99c5fb3/easyproc-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "032f5e1f090a2f00ca518bd08e2e816a", "sha256": "c01fd5206c3a383abb4d79206da363d8a3ec1a3570c22a9b24644e614c0dfbd9" }, "downloads": -1, "filename": "easyproc-0.4.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "032f5e1f090a2f00ca518bd08e2e816a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9644, "upload_time": "2016-09-10T05:32:38", "url": "https://files.pythonhosted.org/packages/17/64/eca523e4f6edac562a03867302d7c71915f13118bba4ed1a96556f71b26a/easyproc-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa665b6ecdef6d391904d640c476bdaa", "sha256": "c3daec038c66f09e48cf8f8272fa0dc1d8b23e6e75ed36d6ffe1db6b7f77c45a" }, "downloads": -1, "filename": "easyproc-0.4.2.tar.gz", "has_sig": false, "md5_digest": "fa665b6ecdef6d391904d640c476bdaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6573, "upload_time": "2016-09-10T05:32:41", "url": "https://files.pythonhosted.org/packages/9e/0d/bfd6d80bb8e345cbceb7c96765b79a63b2d9c2015bd6e3936e42ad5d25b4/easyproc-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "c39151368e767c0aaa04926a181f3782", "sha256": "4a0430791bb8ee34f5da46e9936dcf308454db7a94774242c25214879213561b" }, "downloads": -1, "filename": "easyproc-0.4.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c39151368e767c0aaa04926a181f3782", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9641, "upload_time": "2016-09-22T17:00:08", "url": "https://files.pythonhosted.org/packages/26/43/7146e87111b7b89c2139eee0499916ea183b4805b57a68126b35149d990f/easyproc-0.4.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cab27e4c88438080c93e1cbfb97f526", "sha256": "91921c679028fe462b587a515f3dc8fe604395f9d3c3ddd9a46748ba84f772d7" }, "downloads": -1, "filename": "easyproc-0.4.3.tar.gz", "has_sig": false, "md5_digest": "2cab27e4c88438080c93e1cbfb97f526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6575, "upload_time": "2016-09-22T17:00:10", "url": "https://files.pythonhosted.org/packages/ca/98/7fbeaafb79ce58107d172572ec2ce62f11b7aef25299de36967f337a541d/easyproc-0.4.3.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "4c0b4e1147e76974eb9459e6b3a9e3c7", "sha256": "4a2ffbc617421a63da7e1d1ccd21aaf212b47a58a139f67bf79d8e77fd5cee50" }, "downloads": -1, "filename": "easyproc-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4c0b4e1147e76974eb9459e6b3a9e3c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9520, "upload_time": "2017-08-27T09:02:59", "url": "https://files.pythonhosted.org/packages/93/28/b65b3cf7ddfae683d1895133892e1212b01863229f85808699698458ca1a/easyproc-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5e7ec9b29b1dcd06eb9a8a6cb5fb1d5b", "sha256": "c2c1d60fa41e514bae641410ede7157a54089b9a68dc06e18e198789fde694db" }, "downloads": -1, "filename": "easyproc-0.5.0.tar.gz", "has_sig": false, "md5_digest": "5e7ec9b29b1dcd06eb9a8a6cb5fb1d5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6377, "upload_time": "2017-08-27T09:03:00", "url": "https://files.pythonhosted.org/packages/7e/fa/c1dbed8dd70659ba95f3c6befa2951b26190938cee465eb70f75b1d9ec3b/easyproc-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "017c35d1da888a72eeb6e3bb88906d8d", "sha256": "8131ff1d607ca028b6a04c52c40ac69f69dffc6c85dfa4e5f1d707517cf04ae2" }, "downloads": -1, "filename": "easyproc-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "017c35d1da888a72eeb6e3bb88906d8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9561, "upload_time": "2018-03-26T10:55:09", "url": "https://files.pythonhosted.org/packages/a6/e1/2b27a8540c9bebf146b124760046e8b3649e2e19dc030b47b0a532d5f159/easyproc-0.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0962681bbdc21bd1619d300fd26ce464", "sha256": "8b6daac6731abe71ccfbe1dffcc3734b07259819efd46ef1afde956450c2b483" }, "downloads": -1, "filename": "easyproc-0.5.1.tar.gz", "has_sig": false, "md5_digest": "0962681bbdc21bd1619d300fd26ce464", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6396, "upload_time": "2018-03-26T10:55:10", "url": "https://files.pythonhosted.org/packages/84/57/c1688e9ea7ed9a21b9f1ddff470e2b14f4e8ef58de2983169b9e555b9b8d/easyproc-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "017c35d1da888a72eeb6e3bb88906d8d", "sha256": "8131ff1d607ca028b6a04c52c40ac69f69dffc6c85dfa4e5f1d707517cf04ae2" }, "downloads": -1, "filename": "easyproc-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "017c35d1da888a72eeb6e3bb88906d8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9561, "upload_time": "2018-03-26T10:55:09", "url": "https://files.pythonhosted.org/packages/a6/e1/2b27a8540c9bebf146b124760046e8b3649e2e19dc030b47b0a532d5f159/easyproc-0.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0962681bbdc21bd1619d300fd26ce464", "sha256": "8b6daac6731abe71ccfbe1dffcc3734b07259819efd46ef1afde956450c2b483" }, "downloads": -1, "filename": "easyproc-0.5.1.tar.gz", "has_sig": false, "md5_digest": "0962681bbdc21bd1619d300fd26ce464", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6396, "upload_time": "2018-03-26T10:55:10", "url": "https://files.pythonhosted.org/packages/84/57/c1688e9ea7ed9a21b9f1ddff470e2b14f4e8ef58de2983169b9e555b9b8d/easyproc-0.5.1.tar.gz" } ] }