Sometimes I wonder why the solution needs to be so complicated... Here is an example you can do from Bash in a 1-liner:
python -c "import cloudflare; help(cloudflare)" >> cloudflare.txt