How to generate requirements.txt automatically for your python project using Pigar

As a Python Developer working on shared codebases, its always beneficial to generate a requirements.txt file for your projects, so that the dependencies can be managed better.

requirements.txt

How do we do this without spending too much time?