{ "info": { "author": "Nigel Kukard", "author_email": "nkukard@lbsd.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[![pipeline status](https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess/badges/master/pipeline.svg)](https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess/commits/master)\n[![coverage report](https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess/badges/master/coverage.svg)](https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess/commits/master)\n\n# Forked subprocess support for Python\n\nThis package allows for the running of a subprocess in the background, including the sending of data to the subprocess and\nreceiving of data from it. Threads are used to achieve the reading/writing of data.\n\n\n## Basic usage\n\n```python\nfrom forkedsubprocess import ForkedSubprocess\n\nprocess = ForkedSubprocess(['cat'])\nprocess.run()\nprocess.send('some string')\nreturncode = process.wait()\n\nstdout = process.stdout\nstderr = process.stderr\noutput = process.output\n```\n\n\n## Writing output to console\n\nOutput can be written to the console at the same time using `enable_output=True`.\n\n```python\nfrom forkedsubprocess import ForkedSubprocess\n\nprocess = ForkedSubprocess(['cat'], enable_output=True)\nprocess.run()\nprocess.send('some string')\nreturncode = process.wait()\n\nstdout = process.stdout\nstderr = process.stderr\noutput = process.output\n```\n\n\n## Using a callback\n\nA callback can be used for each line of output received.\n\n```python\nfrom forkedsubprocess import ForkedSubprocess\n\ndef my_callback(line: str):\n\tprint(f'LINE: {line}')\n\nprocess = ForkedSubprocess(['cat'], output_callback=my_callback)\nprocess.run()\nprocess.send('some string')\nreturncode = process.wait()\n\nstdout = process.stdout\nstderr = process.stderr\noutput = process.output\n```\n\n\n# License\n
\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n
\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "forkedsubprocess", "package_url": "https://pypi.org/project/forkedsubprocess/", "platform": "", "project_url": "https://pypi.org/project/forkedsubprocess/", "project_urls": { "Homepage": "https://gitlab.devlabs.linuxassist.net/allworldit/python/forkedsubprocess" }, "release_url": "https://pypi.org/project/forkedsubprocess/1.0.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Forked subprocess support for Python", "version": "1.0.3" }, "last_serial": 5764492, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "866371ec24c6f62fdbe8ed1135e57d4e", "sha256": "0e58f70f734ff7c932a1c9b7367592d70f8529c59e4b80db4519f45f48926b2e" }, "downloads": -1, "filename": "forkedsubprocess-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "866371ec24c6f62fdbe8ed1135e57d4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5597, "upload_time": "2019-08-31T14:28:25", "url": "https://files.pythonhosted.org/packages/63/78/bd8963f1f2acdd1854ed4b2c70eaa4b1b8bf2741e3a793294af62064b1f3/forkedsubprocess-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de95119762161cd11868ca5f97616579", "sha256": "c33d1573ec3ad91917a0812c15cfa0aeeaadf9e56615c6945ca89daee07fdab7" }, "downloads": -1, "filename": "forkedsubprocess-1.0.2.tar.gz", "has_sig": false, "md5_digest": "de95119762161cd11868ca5f97616579", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5043, "upload_time": "2019-08-31T14:28:27", "url": "https://files.pythonhosted.org/packages/7b/f8/3daa1ca03d0380662436fb909dd8cd9140617fe8217dff1f46f1494287b0/forkedsubprocess-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "3aa5b35458cc0901d1791f9c32c5bb39", "sha256": "6f45250724402f1bdc940ac4f6bf23934a5330e3a8b3290f8a1d37c4649ad14d" }, "downloads": -1, "filename": "forkedsubprocess-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "3aa5b35458cc0901d1791f9c32c5bb39", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5672, "upload_time": "2019-08-31T14:49:46", "url": "https://files.pythonhosted.org/packages/8a/20/a4369bc6704c0a7381ad161ebf109f4a3039007be093acefe0caa041b3c9/forkedsubprocess-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac30f326d50d944af934990b3d0e4776", "sha256": "e60072c30d8fcefdf30f6a02fd4e202a1cae3681bf3bb56d31c4875c73662753" }, "downloads": -1, "filename": "forkedsubprocess-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ac30f326d50d944af934990b3d0e4776", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5130, "upload_time": "2019-08-31T14:49:47", "url": "https://files.pythonhosted.org/packages/7c/79/081b129a4fd8f852277084a42ec4d6fd81b78835d5ecdd2e2e5d6a63dbbc/forkedsubprocess-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3aa5b35458cc0901d1791f9c32c5bb39", "sha256": "6f45250724402f1bdc940ac4f6bf23934a5330e3a8b3290f8a1d37c4649ad14d" }, "downloads": -1, "filename": "forkedsubprocess-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "3aa5b35458cc0901d1791f9c32c5bb39", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5672, "upload_time": "2019-08-31T14:49:46", "url": "https://files.pythonhosted.org/packages/8a/20/a4369bc6704c0a7381ad161ebf109f4a3039007be093acefe0caa041b3c9/forkedsubprocess-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac30f326d50d944af934990b3d0e4776", "sha256": "e60072c30d8fcefdf30f6a02fd4e202a1cae3681bf3bb56d31c4875c73662753" }, "downloads": -1, "filename": "forkedsubprocess-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ac30f326d50d944af934990b3d0e4776", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5130, "upload_time": "2019-08-31T14:49:47", "url": "https://files.pythonhosted.org/packages/7c/79/081b129a4fd8f852277084a42ec4d6fd81b78835d5ecdd2e2e5d6a63dbbc/forkedsubprocess-1.0.3.tar.gz" } ] }