stream-delay

Stream a file or stdin one line at a time with a delay

APACHE-2.0 License

Downloads
33
Stars
4
Committers
1

stream-delay

Stream a file or stdin one line at a time with a delay

Installation

Install this tool using pip:

$ pip install stream-delay

Usage

Feed content to this tool either by piping to standard input or using one or more filenames.

The tool will output the data from those inputs one line at a time with a 100ms delay between each line.

You can use -d 500 to change the delay to another value expressed in milliseconds.

Examples:

  • cat myfile.txt | stream-delay - will stream from that file with a 100ms delay between each line
  • stream-delay myfile.txt - same as above, this time using the filename
  • stream-delay myfile.txt myfile2.txt - streams from the first file, then the second file
  • stream-delay myfile.txt -d 1000 - streams from that file with a one second delay between each line

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd stream-delay
python -m venv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest