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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stdpipeio-0.1.2.tar.gz.
File metadata
- Download URL: stdpipeio-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c093e681644e76f4b1d8b73fe42a64037c67785a75770566abdfea61354c5fb0
|
|
| MD5 |
48be756ca25716bc283662e1951f4a22
|
|
| BLAKE2b-256 |
7faa79f13d9a33cd71b4ed0ad22fd3f2ba165c941b08ad259681a36eaab55cdc
|
File details
Details for the file stdpipeIO-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stdpipeIO-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1765eaf3cd5079ee193174a91cc3229dbcc606a80d9548f63fff9529d2333fc6
|
|
| MD5 |
4dea810aa7c2a3593d54a13260d2ba77
|
|
| BLAKE2b-256 |
0bea471862e265677cd71bd55d8b892b4bc91afb679dca916170e613a7965f95
|