Files
Random-Christmas-Bot/src/utils.py
T
jeanGaston 9e2f761544 Add exclusion support, multi-year history helper, and remove secrets from env.py
- draw.py/file_io.py/main.py: wire in exclusion pairs so the draw can avoid
  configured giver/receiver combinations.
- utils.py: add get_last_n_years helper.
- env.py: load configuration from environment variables (via .env) instead of
  hardcoding real SMTP/CSV secrets in a tracked file; add .env.example as the
  template and gitignore .env.
- test_draws.py: drop hardcoded personal path, use env.py config instead.
- add requirements.txt for the upcoming web GUI/container work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-20 14:16:12 +02:00

17 lines
507 B
Python

from datetime import date
import time
def get_current_time():
""" Return the current date and time """
today = date.today()
current_time = time.strftime("%H:%M:%S", time.localtime())
return today.strftime("%d/%m/%Y"), current_time
def get_last_n_years(n) -> list:
last_n_years = []
last_n_years.append(date.today().year)
for i in range (1,n+1):
last_n_years.append(date.today().year - i)
return last_n_years
if __name__ == "__main__":
print(get_last_n_years(3))