Skip to content

Instantly share code, notes, and snippets.

@NatLee
Created August 30, 2021 05:18
Show Gist options
  • Save NatLee/77d27e089d6f2e7fb232e5b17f3b427e to your computer and use it in GitHub Desktop.
Save NatLee/77d27e089d6f2e7fb232e5b17f3b427e to your computer and use it in GitHub Desktop.
Report template generator with date
'''
### Week 01
- 01/06
- 01/07
- 01/08
- 01/09
- 01/10
**Weekly conclusion**
|Week 01|20200106 - 20200110|
|---|---|
|Nat Lee||
'''
from datetime import datetime, timedelta
AUTHOR = 'Nat Lee'
today = datetime.today()
week_number = today.isocalendar()[1]
monday = today - timedelta(days=today.weekday())
print(f'### Week {week_number}')
print()
for i in range(5):
thisweek = monday + timedelta(days=i)
print(f'- {str(thisweek.month).zfill(2)}/{str(thisweek.day).zfill(2)}')
print()
print('**Weekly conclusion**')
print()
print(f'|Week {str(week_number).zfill(2)}|{monday.strftime("%Y%m%d")} - {thisweek.strftime("%Y%m%d")}|')
print('|---|---|')
print(f'|{AUTHOR}||')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment