Where can I learn about fluent style of writing python?
I recently learnt basics of python with a little background in JavaScript (Node.js). I was trying to automate video transcoding with the ffmpeg-python. In the example , code 1
import ffmpeg
stream = ffmpeg.input('input.mp4')
stream = ffmpeg.hflip(stream)
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream)
Does the same job as , code 2 (fluent)
import ffmpeg
(
ffmpeg
.input('input.mp4')
.hflip()
.output('output.mp4')
.run()
)
- I find the code 2 style better and would like to learn how it works
- What are the parenthesis that encode ffmpeg chain imply?
- Can it used with most of the popular python modules ? Atleast the popular ones
The closes thing I could find was fluentpy but ffmpeg-python examples doesn't specify importing it or I missed it