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 src.pipeio import pipe_io

@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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

stdpipeIO-0.1.0-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stdpipeIO-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0aca7fe04838a5147ac0f55b20a31c1ebf056ff3e8c814ea0f2b0ae41be8f1c
MD5 b5672e392faa40a67b46cbd9edef1804
BLAKE2b-256 6b9d7c66514980d848772c069344a694ef1dfb6ad39d8eb4d85559b7fb0de92c

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