Is it possible to convert string to method's argument?
Let say I can get such strings 'weeks', 'months', 'years'.
Now I have this:
from dateutil.relativedelta import relativedelta
from datetime import date
today = date.today()
So after this I need to increment today by the type of duration that is written in string. For example if string would be provided 'years', then it should do this (duration number let say is 10):
some_date = today + relativedelta(years=10)
Of course I could do this using ifs and checking what kind of string was passed. But maybe there is better way to just convert string to that keyword, so I would not need many ifs for this approach?