Sure I could write this myself, but before I go reinventing the wheel is there a function that already does this?
This is very simple and works in python3:
from datetime import datetime # Get current date-time. now = datetime.now() # Determine which quarter of the year is now. Returns q1, q2, q3 or q4. quarter_of_the_year = 'q'+str((now.month-1)//3+1)