Skip to main content

A simple decorator for receiving and sending data via the standard pipe

Project description

stdpipeIO

stdpipeIO is a simple Python decorator for receiving and sending data via the standard pipe. It allows you to easily read input from standard input (stdin) and write output to standard output (stdout).

Installation

To install stdpipeIO, you can use the following command:

pip install stdpipeIO

Usage

To use the pipe_io decorator, simply import it and apply it to your function. The decorated function will read input from stdin, process it, and write the result to stdout.

from stdpipeIO.std_pipe_io import std_pipe_io

@std_pipe_io
def process_input(input_data):
    return input_data.upper()

if __name__ == '__main__':
    process_input()

You can then run your script and provide input via stdin:

echo "Hello, World!" | python your_script.py

The output will be:

HELLO, WORLD!

Testing

To run the tests for stdpipeIO, you can use the following command:

python -m unittest discover tests

License

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

Author

Greendog - x6reend0g@foxmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stdpipeio-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stdpipeIO-0.1.3-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file stdpipeio-0.1.3.tar.gz.

File metadata

  • Download URL: stdpipeio-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for stdpipeio-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8e3fb3aef842fc98160c484388ec0de089ea32e45cfc0d0e3cccc88b8f5e7372
MD5 ddb9ba939b08dee67e4c9d26d1326f5b
BLAKE2b-256 120a1d88381e21c6361bd4c41f21badbf1e60ce609b6d59f581c566beee268da

See more details on using hashes here.

File details

Details for the file stdpipeIO-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: stdpipeIO-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for stdpipeIO-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b20ab4d5f836c96572374adc50f94ac24c6729d05b9c526864b20cda7eb0c4a
MD5 1c776156dda2615b07e04a505993d8d0
BLAKE2b-256 fd8f67faf01848a25e95ece532d25a5cdc1e5c2c2a9244797fbd1dce5bc56a5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page