def human_time_ago(seconds_ago: float) -> str:
"""Return time difference as human-readable string"""
periods = (
("year", 60 * 60 * 24 * 365),
("month", 60 * 60 * 24 * 30),
("week", 60 * 60 * 24 * 7),
("day", 60 * 60 * 24),
("hour", 60 * 60),
("minute", 60),
)
for period, seconds_each in periods:
if seconds_ago >= seconds_each:
how_many = int(seconds_ago / seconds_each)
return f"{how_many} {period}{'s' if how_many >= 2 else ''} ago"