Authentication API for Inventory

Authentication API for Inventory

I'm trying to create an integration with Zoho Inventory but am hung up on the way the OAuth requests work. If I use Postman, no problem. But if I try to use python (because I don't want to manually interact with the API). I'm stuck on the first few steps from the document "Oauth Steps - Zoho Inventory API".

1. Register as Server based Applications (done)
2. Generate Grant Code (issue here)
This requires the use of a browser and authentication which means I have to manually do this step each time I want to run an integration process.  Is there a way to make this step programmatically through python?

3. Generate Refresh Token and Access token
4. Generate Access token using Refresh token each time

Does anyone have a sample of these steps using python?
Thanks!