Connecting to bitbucket api with python?

How to use REST API in bitbucket to populate a csv file in python ?

Hi I am currently new in using bitbucket REST api , while there are documentations out there I am currently unable to link it with my current problem. I would like to use the REST API to be able to write a script in python that will then populate a csv file with fields such as commit id , commit author , the repository where it was commited , and the branch where the commit happened in the repository ? I followed an article called Doing the Bitbucket OAuth dance with Python - Atlassian Developer Blog while this did help me but I am unable to write a single script where the OAuth happens and I am then able to parse the json into a csv file with the above listed headers . I am looking for some suggestions currently I am using requests and json to convert the output in a dictionary to be able to loop through it but I am still unable to achieve my above listed target . I really hope if anyone could guide me for the steps I should take what end point I should ideally use and how to perform the authentication through the script (the article link requires me to copy and paste ) and then be able to extract commit id , repository , branch , commit author . Thankyou !