Skip to main content

Subprocesslib

subprocesslib is a Python library that aims to be like pathlib but for the subprocess module.

Usage

Here's a simple example of how to use SubprocessLib:

from subprocesslib import Command

command = Command('tail', '-n', 5, '/var/log/syslog')
print(command)  # Command('tail', '-n', '5', '/var/log/syslog')
print(isinstance(command, tuple))  # True
print(str(command))  # "tail -n 5 /var/log/syslog" (using `shlex.join`)

# sync methods
command.spawn()  # same as `subprocess.Popen(...)`
command.run()  # same as `subprocess.run(...)`
command.output()  # same as `subprocess.check_output(...)`

# async methods
await command.spawn_async()  # Same as `asyncio.create_subprocess_exec(...)`

Todo

  • await command.run_async()
  • await command.output_async()

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for subprocesslib 0.1.0

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

Source distribution (sdist)

Source distribution for subprocesslib 0.1.0
File Size Uploaded
subprocesslib-0.1.0.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subprocesslib 0.1.0
File Interpreter ABI Platform
subprocesslib-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 kB

Release files / subprocesslib-0.1.0.tar.gz

Download URL subprocesslib-0.1.0.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
20ade6ec52b31f0b7fd4d022d70d652529fcb0a7e7f4140d0e2b2eefcb792914
BLAKE2b-256 checksum
How to use checksums
d36c280cf9fed9c09a5364681ba02b5e55808480d2a300d2137e7703332ba400
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release files / subprocesslib-0.1.0-py3-none-any.whl

Download URL subprocesslib-0.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bfcb65a45ce27f97b0c9f186be373eb505418905d280a6d3abd9604a100afe9
BLAKE2b-256 checksum
How to use checksums
a672315d6aa00085573e9dde47df399a97201b31332baf0fd0738f11c456d344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release history Release notifications | RSS feed

This release

0.1.0 This release

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