{ "info": { "author": "Jack O'Connor", "author_email": "oconnor663@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# duct.py [![Actions Status](https://github.com/oconnor663/duct.py/workflows/tests/badge.svg)](https://github.com/oconnor663/duct.py/actions) [![Coverage Status](https://coveralls.io/repos/oconnor663/duct.py/badge.svg?branch=master&service=github)](https://coveralls.io/github/oconnor663/duct.py?branch=master) [![PyPI version](https://badge.fury.io/py/duct.svg)](https://pypi.python.org/pypi/duct) [![Documentation Status](https://readthedocs.org/projects/ductpy/badge/?version=latest)](https://ductpy.readthedocs.io/en/latest/?badge=latest)\n\nDuct is a library for running child processes. Duct makes it easy to\nbuild pipelines and redirect IO like a shell. At the same time, Duct\nhelps you write correct, portable code: whitespace is never significant,\nerrors from child processes get reported by default, and a variety of\n[gotchas, bugs, and platform\ninconsistencies](https://github.com/oconnor663/duct.py/blob/master/gotchas.md)\nare handled for you the Right Way\u2122.\n\n- [Documentation](https://ductpy.readthedocs.io)\n- [PyPI package](https://pypi.python.org/pypi/duct)\n- [the same library, in Rust](https://github.com/oconnor663/duct.rs)\n\nExamples\n--------\n\nRun a command without capturing any output. Here \"hi\" is printed directly to\nthe terminal:\n\n```python\n>>> from duct import cmd\n>>> cmd(\"echo\", \"hi\").run()\nhi\nOutput(status=0, stdout=None, stderr=None)\n```\n\nCapture the standard output of a command. Here \"hi\" is returned as a string:\n\n```python\n>>> cmd(\"echo\", \"hi\").read()\n'hi'\n```\n\nCapture the standard output of a pipeline:\n\n```python\n>>> cmd(\"echo\", \"hi\").pipe(cmd(\"sed\", \"s/i/o/\")).read()\n'ho'\n```\n\nMerge standard error into standard output and read both incrementally:\n\n```python\n>>> big_cmd = cmd(\"bash\", \"-c\", \"echo out && echo err 1>&2\")\n>>> reader = big_cmd.stderr_to_stdout().reader()\n>>> with reader:\n... reader.readlines()\n[b'out\\n', b'err\\n']\n```\n\nChildren that exit with a non-zero status raise an exception by default:\n\n```python\n>>> cmd(\"false\").run()\nTraceback (most recent call last):\n...\nduct.StatusError: Expression cmd('false') returned non-zero exit status: Output(status=1, stdout=None, stderr=None)\n>>> cmd(\"false\").unchecked().run()\nOutput(status=1, stdout=None, stderr=None)\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/oconnor663/duct.py", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "duct", "package_url": "https://pypi.org/project/duct/", "platform": "", "project_url": "https://pypi.org/project/duct/", "project_urls": { "Homepage": "https://github.com/oconnor663/duct.py" }, "release_url": "https://pypi.org/project/duct/0.6.4/", "requires_dist": null, "requires_python": "", "summary": "a library for running child processes", "version": "0.6.4", "yanked": false, "yanked_reason": null }, "last_serial": 8807795, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7ef7bd8fa7c9753dbe70d269e89aea33", "sha256": "0c75760e427774116c7fe9d620bb69b8db6e13fcb94409ba66d0c548891989d5" }, "downloads": -1, "filename": "duct-0.0.1.tar.gz", "has_sig": false, "md5_digest": "7ef7bd8fa7c9753dbe70d269e89aea33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6707, "upload_time": "2015-10-26T00:59:37", "upload_time_iso_8601": "2015-10-26T00:59:37.681727Z", "url": "https://files.pythonhosted.org/packages/3c/fe/0178edd3dd5264c8d5e5e0eb7b8c80e08702e7264c232de4909146144911/duct-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "55e75ed645c9572b27db0687ac427579", "sha256": "7ce0279e893ba4907ccea7824ef27d22d005ae29311539a9f8f956fa457f2f1d" }, "downloads": -1, "filename": "duct-0.1.0.tar.gz", "has_sig": false, "md5_digest": "55e75ed645c9572b27db0687ac427579", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7887, "upload_time": "2016-01-21T04:10:01", "upload_time_iso_8601": "2016-01-21T04:10:01.832654Z", "url": "https://files.pythonhosted.org/packages/78/8b/faa0df220397b8bec1da03507b06620147eccec078d89179da3dc618c385/duct-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ddf2400d4f0e2d59635e11237194c11a", "sha256": "c127eac22cab02527ffd26335fdcd524a98de604c6e4ab33cba3c9a14cc88f85" }, "downloads": -1, "filename": "duct-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ddf2400d4f0e2d59635e11237194c11a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7837, "upload_time": "2016-03-04T15:45:54", "upload_time_iso_8601": "2016-03-04T15:45:54.665111Z", "url": "https://files.pythonhosted.org/packages/8f/d7/4bcdf42fdfb6214278ba84dcb8d345206a74be7e1733112e0f52cb7d30a7/duct-0.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "47567e26c2954641b680d51f8210587c", "sha256": "2515077bc5fbb3f60199670d05c3383e622da205ef6d37d3132f3eff17c1ee40" }, "downloads": -1, "filename": "duct-0.3.0.tar.gz", "has_sig": false, "md5_digest": "47567e26c2954641b680d51f8210587c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6190, "upload_time": "2016-06-02T05:39:00", "upload_time_iso_8601": "2016-06-02T05:39:00.394903Z", "url": "https://files.pythonhosted.org/packages/cc/63/091fd701056a3febb9eac35fefcdc97f70e59c95653d5145387bace0e3ff/duct-0.3.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "5219eb87019e07f8126e7e1cd57fdf54", "sha256": "bd40928f50a99cb1f585e902424b51ee4f65ad49ed98d9321eb69dd40961ec5e" }, "downloads": -1, "filename": "duct-0.5.0.tar.gz", "has_sig": false, "md5_digest": "5219eb87019e07f8126e7e1cd57fdf54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7138, "upload_time": "2016-12-31T00:13:41", "upload_time_iso_8601": "2016-12-31T00:13:41.938021Z", "url": "https://files.pythonhosted.org/packages/5a/2d/4a6826176fda256ae4ffaa277bd563e7ee6ba1bec1cb12dd987d62f64ada/duct-0.5.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "4aac818fad87a51c21e8b588188101c6", "sha256": "c0e2a22ae1aa55a93eda4b36091ca3a53c5ae76ed1ec79bbb174b35b8a6e3cac" }, "downloads": -1, "filename": "duct-0.5.1.tar.gz", "has_sig": false, "md5_digest": "4aac818fad87a51c21e8b588188101c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10788, "upload_time": "2017-10-17T05:38:01", "upload_time_iso_8601": "2017-10-17T05:38:01.395443Z", "url": "https://files.pythonhosted.org/packages/0d/14/6bd1addc949f614838b8c77e52f2145980fdfaae48511eb50a80134f8e91/duct-0.5.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "004c41769d9c82daf7a1b25e52aefb1f", "sha256": "02f65169fdd66ad739493ea724b942925d8901a7825a207a332a01f92186f91d" }, "downloads": -1, "filename": "duct-0.6.0.tar.gz", "has_sig": false, "md5_digest": "004c41769d9c82daf7a1b25e52aefb1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15027, "upload_time": "2019-09-22T16:11:11", "upload_time_iso_8601": "2019-09-22T16:11:11.416785Z", "url": "https://files.pythonhosted.org/packages/78/64/760879e4e28ed2634ecdc3d8528a912a0a66dd5d951aaceea9a73e4597f9/duct-0.6.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "1cfa8b67a354c0618d79c610aa77e1e0", "sha256": "6da306292254a8ed2ab1720665c307e52ee1db24130b9417838dfb0b0d45e527" }, "downloads": -1, "filename": "duct-0.6.1.tar.gz", "has_sig": false, "md5_digest": "1cfa8b67a354c0618d79c610aa77e1e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15504, "upload_time": "2019-10-12T06:10:39", "upload_time_iso_8601": "2019-10-12T06:10:39.507801Z", "url": "https://files.pythonhosted.org/packages/17/1a/a6832e71d2391baa2890874fbfded44fbd74e8288f1ab7585a791e4bcf66/duct-0.6.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "e5286afce1ba5b7d9a1f25ed7e0c77f4", "sha256": "9f85b30ef12278efba5d61f4a91216b2393773abf9c8c31af28efc5b3a662c85" }, "downloads": -1, "filename": "duct-0.6.2.tar.gz", "has_sig": false, "md5_digest": "e5286afce1ba5b7d9a1f25ed7e0c77f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15722, "upload_time": "2019-10-15T17:17:19", "upload_time_iso_8601": "2019-10-15T17:17:19.852913Z", "url": "https://files.pythonhosted.org/packages/51/ef/e01ebfa1ffeee62dcb2536a6e8b54257997934b0e420132e9d917151cd06/duct-0.6.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "63322cfdd458e200b56fabc699e653c0", "sha256": "517ef66b56c8cfcd39be97f72d54efbf788d06bfdac7837eecf06e81b6b235d1" }, "downloads": -1, "filename": "duct-0.6.3.tar.gz", "has_sig": false, "md5_digest": "63322cfdd458e200b56fabc699e653c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15953, "upload_time": "2019-10-30T13:58:12", "upload_time_iso_8601": "2019-10-30T13:58:12.745905Z", "url": "https://files.pythonhosted.org/packages/8a/43/0898e288bc3c929e964c9c9fd2a2c418959d51feff382734ea63910399c0/duct-0.6.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "7e21a87c86da46fc8424a87d0002d571", "sha256": "992c7e791172f62fa1d9c20b6ddf85042a74528b34fe8a77237370f6b01130fc" }, "downloads": -1, "filename": "duct-0.6.4.tar.gz", "has_sig": false, "md5_digest": "7e21a87c86da46fc8424a87d0002d571", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16397, "upload_time": "2020-12-03T06:49:56", "upload_time_iso_8601": "2020-12-03T06:49:56.161306Z", "url": "https://files.pythonhosted.org/packages/1e/4a/3aa110d64ac800cd92db968dc90a46233231839318cb18378b474553468b/duct-0.6.4.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7e21a87c86da46fc8424a87d0002d571", "sha256": "992c7e791172f62fa1d9c20b6ddf85042a74528b34fe8a77237370f6b01130fc" }, "downloads": -1, "filename": "duct-0.6.4.tar.gz", "has_sig": false, "md5_digest": "7e21a87c86da46fc8424a87d0002d571", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16397, "upload_time": "2020-12-03T06:49:56", "upload_time_iso_8601": "2020-12-03T06:49:56.161306Z", "url": "https://files.pythonhosted.org/packages/1e/4a/3aa110d64ac800cd92db968dc90a46233231839318cb18378b474553468b/duct-0.6.4.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }