You can do that with datetime.strptime()
Example:
>>> from datetime import datetime
>>> datetime.strptime('2012-02-10' , '%Y-%m-%d')
datetime.datetime(2012, 2, 10, 0, 0)
>>> _.isoweekday()
5
You can find the table with all the strptime
directive here.
To increment by 2 days if .isweekday() == 6
, you can use timedelta():
>>> import datetime
>>> date = datetime.datetime.strptime('2012-02-11' , '%Y-%m-%d')
>>> if date.isoweekday() == 6:
... date += datetime.timedelta(days=2)
...
>>> date
datetime.datetime(2012, 2, 13, 0, 0)
>>> date.strftime('%Y-%m-%d') # if you want a string again
'2012-02-13'