Skip to main content

reversefold.util

Available on pypi

This is a collection of various command-line scripts and libraries which have come in useful over the years I've worked with Python.

log.py

Captures stdout of a process and enables transformation the output (such as adding a timestamp to each line) and is compatible with external logrotate through WatchedFileHandler.

daemonize.py

Useful for daemonizing another process which either does not daemonize itself or for which you want to capture stdout and stderr to log files. Uses WatchedFileHandler for output to log files to allow for external log rotation.

stream.py

Similar to tail -f but with some more options for type of buffering and supports streaming the entire current contents of the file before then following the tail of the file.

reversefold.util

rate_limit_gen

A generator wrapper which rate-limits another generator. If the rate is exceeded, further values received within the period are discarded. Useful, for example, for making sure that the number of lines you display from a log file you're following don't cause your terminal to block while displaying a huge amount of output.

chunked

Breaks up an iterable into equal-sized chunks.

reversefold.util.ssh

SSHHost

A programmatic interface to ssh. Allows easily running a single command or a shell script or interactively sending input and displaying output. Originally written as a drop-in monkeypatch for fabric's use of paramiko.

reversefold.util.multiproc

run_subproc

Takes a subprocess as input and sets up threads for handling and displaying stdout and stderr from the process. Defaults to blocking until the process is finished but also supports immediately returning and including the threads in the return value. Also defaults to capturing the stdout and stderr and returning them as lists of lines.

reversefold.util.proc

Provides context managers to ensure that a process is sent a TERM or KILL signal (or both) to a process when the context block exits. Can optionally find child processes recursively and send the same signal(s) to them. Also provides functions for the same functionality.

Metadata

Release files for reversefold.util 3.5.5

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

Source distribution (sdist)

Source distribution for reversefold.util 3.5.5
File Size Uploaded
reversefold.util-3.5.5.tar.gz 15.9 kB Details

Built distribution (wheel)

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

Total release size: 35.9 kB

Release files / reversefold.util-3.5.5.tar.gz

Download URL reversefold.util-3.5.5.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4e6f202dce8b5870493b13c85264ced78a4eeb7bdd1d9d115aa5145ecad1daf1
BLAKE2b-256 checksum
How to use checksums
8336337d67fac3f6c8e53ce19595f1eae4e3a48b4cb0a59806b3f331768a5928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release files / reversefold.util-3.5.5-py3-none-any.whl

Download URL reversefold.util-3.5.5-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05f67816489a03e22c3052dd597055679c1a9a85a99c31ae7c7ee6b277dd6bc4
BLAKE2b-256 checksum
How to use checksums
1dd2f76e1554bc233300bb63512500d75b008f34eac747bcd39ed3c1aa1032fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

3.5.5 This release

2 release files

3.5.4

2 release files

3.5.3

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.0

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.19.2

1 release file

1.19.1

1 release file

1.19

1 release file

1.18.2

1 release file

1.18.1

1 release file

1.18.0

1 release file

1.17.0

1 release file

1.16.0

1 release file

1.15.6

1 release file

1.15.5

1 release file

1.15.4

1 release file

1.15.3

1 release file

1.15.2

1 release file

1.15.1

1 release file

1.15.0

1 release file

1.14.0

1 release file

1.13.3

1 release file

1.13.2

1 release file

1.13.1

1 release file

1.13.0

1 release file

1.12.3

1 release file

1.12.2

1 release file

1.12.1

1 release file

1.12.0

1 release file

1.11.2

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.0

1 release file

1.9.2

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.4

1 release file

1.0.2

1 release file

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