June 2025
Intermediate to advanced
837 pages
24h 50m
English
You can think of a transform stream as a link in a chain between its beginning and end, where you can attach several of these links together. As the name implies, a transform stream is used to transform an input into an output by applying defined rules. In this context, both the input and the output are also streams.
To implement a transform stream, you must derive your class from the transform class of the stream module and implement the _transform method. At its core, a transform stream represents a simplification of a duplex stream. The transform class derives from duplex and combines the readable and writable streams.
A concrete example of such a transform stream is as follows: ...
Read now
Unlock full access