{"id":18657612,"url":"https://github.com/cr0hn/python-pipes","last_synced_at":"2025-04-11T18:31:35.258Z","repository":{"id":57457377,"uuid":"261758168","full_name":"cr0hn/python-pipes","owner":"cr0hn","description":"Helpers to manage stdin / stdout and UNIX pipes","archived":false,"fork":false,"pushed_at":"2020-05-20T10:04:18.000Z","size":11,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T17:09:46.877Z","etag":null,"topics":["pipeline","stderr","stdin","stdout","unix"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cr0hn.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-06T12:54:48.000Z","updated_at":"2020-11-06T04:11:44.000Z","dependencies_parsed_at":"2022-09-05T18:12:32.045Z","dependency_job_id":null,"html_url":"https://github.com/cr0hn/python-pipes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fpython-pipes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fpython-pipes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fpython-pipes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fpython-pipes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cr0hn","download_url":"https://codeload.github.com/cr0hn/python-pipes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458503,"owners_count":21107089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pipeline","stderr","stdin","stdout","unix"],"created_at":"2024-11-07T07:29:10.768Z","updated_at":"2025-04-11T18:31:34.820Z","avatar_url":"https://github.com/cr0hn.png","language":"Python","readme":"Python pipes\n============\n\nThis projects allow to read stdin and detect if input data comes from a UNIX pipe and if the output is connected to a UNIX pipe.\n\nInstall\n-------\n\n.. code-block:: console\n\n    \u003e pip install python-pipes\n\nHow to use\n----------\n\nBasic example of a tool that read from info stdin:\n\n.. code-block:: python\n\n    # file: basic_example.py\n    from python_pipes import read_stdin_lines\n\n    def main():\n        for is_stdin_pipe, is_stdout_pipe, line in read_stdin_lines():\n            print(\"Input connected to pipe: \", is_stdin_pipe)\n            print(\"Output  connected to pipe: \", is_stdout_pipe)\n            print(\"Line read: \", line)\n\n\n    if __name__ == '__main__':\n        main()\n\nResults depending of how to execute them:\n\n.. code-block:: console\n\n    $ python basic_example.py\n    Input connected to pipe:  False\n    Output  connected to pipe:  False\n    Line read:  None\n    $\n    $ echo \"hello\" | python basic_example.py\n    Input connected to pipe:  True\n    Output  connected to pipe:  False\n    Line read:  hello\n    $\n    $ echo \"hello\" | python basic_example.py | awk '{print $0}'\n    Input connected to pipe:  True\n    Output  connected to pipe:  True\n    Line read:  hello","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0hn%2Fpython-pipes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcr0hn%2Fpython-pipes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0hn%2Fpython-pipes/lists"}