subprocess-tee


Namesubprocess-tee JSON
Version 0.4.2 PyPI version JSON
download
home_pageNone
Summarysubprocess-tee
upload_time2024-06-17 19:51:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords subprocess asyncio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # subprocess-tee

This package provides a drop-in alternative to `subprocess.run` that
captures the output while still printing it in **real-time**, just the way
`tee` does.

Printing output in real-time while still capturing is valuable for
any tool that executes long-running child processes. For those, you do want
to provide instant feedback (progress) related to what is happening.

```python
# from subprocess import run
from subprocess_tee import run

result = run("echo 123")
result.stdout == "123\n"
```

You can add `tee=False` to disable the tee functionality if you want, this
being a much shorter alternative than adding the well known
`stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL`.

Keep in mind that `universal_newlines=True` is implied as we expect text
processing, this being a divergence from the original `subprocess.run`.

You can still use `check=True` in order to make it raise CompletedProcess
exception when the result code is not zero.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "subprocess-tee",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Sorin Sbarnea <sorin.sbarnea@gmail.com>",
    "keywords": "subprocess, asyncio",
    "author": null,
    "author_email": "Sorin Sbarnea <sorin.sbarnea@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d7/22/991efbf35bc811dfe7edcd749253f0931d2d4838cf55176132633e1c82a7/subprocess_tee-0.4.2.tar.gz",
    "platform": null,
    "description": "# subprocess-tee\n\nThis package provides a drop-in alternative to `subprocess.run` that\ncaptures the output while still printing it in **real-time**, just the way\n`tee` does.\n\nPrinting output in real-time while still capturing is valuable for\nany tool that executes long-running child processes. For those, you do want\nto provide instant feedback (progress) related to what is happening.\n\n```python\n# from subprocess import run\nfrom subprocess_tee import run\n\nresult = run(\"echo 123\")\nresult.stdout == \"123\\n\"\n```\n\nYou can add `tee=False` to disable the tee functionality if you want, this\nbeing a much shorter alternative than adding the well known\n`stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL`.\n\nKeep in mind that `universal_newlines=True` is implied as we expect text\nprocessing, this being a divergence from the original `subprocess.run`.\n\nYou can still use `check=True` in order to make it raise CompletedProcess\nexception when the result code is not zero.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "subprocess-tee",
    "version": "0.4.2",
    "project_urls": {
        "changelog": "https://github.com/pycontribs/subprocess-tee/releases",
        "documentation": "https://subprocess-tee.readthedocs.io",
        "homepage": "https://github.com/pycontribs/subprocess-tee",
        "repository": "https://github.com/pycontribs/subprocess-tee"
    },
    "split_keywords": [
        "subprocess",
        " asyncio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4dabe3a3be062cd544b2803760ff707dee38f0b1cb5685b2446de0ec19be28d9",
                "md5": "dde686d9ccf7c85a95623fff0d09f306",
                "sha256": "21942e976715af4a19a526918adb03a8a27a8edab959f2d075b777e3d78f532d"
            },
            "downloads": -1,
            "filename": "subprocess_tee-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dde686d9ccf7c85a95623fff0d09f306",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5249,
            "upload_time": "2024-06-17T19:51:15",
            "upload_time_iso_8601": "2024-06-17T19:51:15.949024Z",
            "url": "https://files.pythonhosted.org/packages/4d/ab/e3a3be062cd544b2803760ff707dee38f0b1cb5685b2446de0ec19be28d9/subprocess_tee-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d722991efbf35bc811dfe7edcd749253f0931d2d4838cf55176132633e1c82a7",
                "md5": "141ae2cd087f59c1ddb09261724167f1",
                "sha256": "91b2b4da3aae9a7088d84acaf2ea0abee3f4fd9c0d2eae69a9b9122a71476590"
            },
            "downloads": -1,
            "filename": "subprocess_tee-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "141ae2cd087f59c1ddb09261724167f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14951,
            "upload_time": "2024-06-17T19:51:51",
            "upload_time_iso_8601": "2024-06-17T19:51:51.249578Z",
            "url": "https://files.pythonhosted.org/packages/d7/22/991efbf35bc811dfe7edcd749253f0931d2d4838cf55176132633e1c82a7/subprocess_tee-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-17 19:51:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pycontribs",
    "github_project": "subprocess-tee",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "subprocess-tee"
}
        
Elapsed time: 0.26426s