Skip to main content

Pipes

Subprocess utils

Status

Source Shields
Project license release
Publishers pypi
Downloads pypi_downloads
Raised issues pulls

Installing

To install the package from pypi:

pip install simple_pipes

Alternatively, you can clone the repo and build the package locally.

Usage

Pass a command in exec form:

from simple_pipes import pipe_call, pipe_capture

pipe_call(["echo", "Hello"])

This is equivalent to:

import subprocess

subprocess.Popen(["echo", "Hello"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

Changing directory before execxution:

pipe_call(["echo", "Hello"], cwd=".")

If you're running a command does not terminate, such as starting a server, the program will remain attached.

To detach the running process on a given string output:

wrapper = pipe_call(["echo", "Hello"], break_str="Hello"):

You must keep the wrapper object in scope or the detached process will be terminated in garbage collection.

Often you want to run a process until it terminates and capture the entire output:

output = pipe_capture(["echo", "Hello"], cwd=".")

print(output)

>> Hello

Docs

Additional details are available in the full documentation.

To generate the documentation locally:

multi-job docs

Tests

Unit tests and behaviour tests are written with the pytest framework.

To run tests:

multi-job tests

Additionally, an html report will be saved to the local directory.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Versioning

SemVer is used for versioning. For a list of versions available, see the tags on this repository.

Bump2version is used to version and tag changes. For example:

bump2version patch

Releases are made on every major change.

Author

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

None yet!

Metadata

Release files for simple-pipes 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-pipes 0.3.1
File Size Uploaded
simple_pipes-0.3.1.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-pipes 0.3.1
File Interpreter ABI Platform
simple_pipes-0.3.1-py2-none-any.whl Python 2 none any Details

Total release size: 8.3 kB

Release files / simple_pipes-0.3.1.tar.gz

Download URL simple_pipes-0.3.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d5601b7f66a677cc18cd041a6944935019561d1b94048ea6be34a2a873553913
BLAKE2b-256 checksum
How to use checksums
3f6c65665841c82ad0969454221f7f157b6922cb20cf00c24abada9deb96d9c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.6

Release files / simple_pipes-0.3.1-py2-none-any.whl

Download URL simple_pipes-0.3.1-py2-none-any.whl
Size 4.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
305f2092a9b15759dee723dceee134be9df9004c00e03312f62f9985b8916f0e
BLAKE2b-256 checksum
How to use checksums
3e94eca7181a1848c203c78d18ce28abb7631185bbbef81bbcfe14694eb9e4bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page