std_encode
Encode and decode files through standard input/output.
Usage
Encode files piping them into std_encode
$ std_encode -t input_test.txt
>>>>>>>>>> START t input_test.txt
Some test
text file
<<<<<<<<<< END
The encoded text can be then decoded and saved with std_decode
$ std_encode -t input_test.txt | std_decode
######### DECODED FILE input_test.txt
$ cat input_test.txt
Some test
text file
Install
The package is available in PyPI
pip install std-encode
Features
- A log shows that a file has been decoded
- Text and binary files are supported (binary are default).
std_decodeis capable of decoding more than one file in the same stream- Any line in the stream that's not part of a file will be replicated in the standard output.
Why is this useful for?
In some cases, standard input/output is a convenient and easy way of communication. Transfering a file is not as simple.
For example, the problem that originated it was to retrieve files from a docker container running in Kubernetes. Obtaining the text log is easy calling docker logs or kubectl logs, but retrieving files requires more plumbing.
In the operation, while creating logs, multiple files can be encoded, and then all will be retrieved piping the logs through std_decode, generating a resulting log like this one:
========================= test session starts ==========================
platform darwin -- Python 3.7.0, pytest-3.9.2, py-1.7.0, pluggy-0.8.0
rootdir: /Users/jaimebuelta/Dropbox/code/std_encode, inifile:
plugins: cram-0.2.0
collected 8 items
tests/base.t . [ 12%]
tests/double_file.t . [ 25%]
tests/encode_decode_image.t . [ 37%]
tests/encode_decode_text.t . [ 50%]
tests/encode_image.t . [ 62%]
tests/encode_text.t . [ 75%]
tests/single_file.t . [ 87%]
tests/test_se.py . [100%]
======================= 8 passed in 2.22 seconds =======================
######### DECODED FILE junit_test.xml
######### DECODED FILE html_report.html
Metadata
Release files for std-encode 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| std_encode-0.2.3.tar.gz | 3.9 kB | Without provenance | Details for std_encode-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| std_encode-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for std_encode-0.2.3-py3-none-any.whl |
Total release size: 10.3 kB
Release files / std_encode-0.2.3.tar.gz
| Download URL | std_encode-0.2.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b53945ea5ea20cf13cea4a75a025486f5b3b5b7a4409e6ee9c210e74c049906
|
|
BLAKE2b-256 checksum How to use checksums |
19cc929a3aea8ba68a54f3a24ebe5d9d2124b45bf539102e0a5837b401ef754c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.11 CPython/3.7.1 Linux/4.15.0-1026-gcp
|
Release files / std_encode-0.2.3-py3-none-any.whl
| Download URL | std_encode-0.2.3-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78c0ef959dee56ea6f1413b997cd529e68103b1bbef4c9f07f989cc3910ddab8
|
|
BLAKE2b-256 checksum How to use checksums |
7bda6c205b50be0bdb14c19f0d90089b9d41a72d98ab52a8987d864c0409d812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.11 CPython/3.7.1 Linux/4.15.0-1026-gcp
|
Security for std-encode 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.