Connection
Base URL, credentials and a reachable server.
Keep week-based API fields beside the calendar conversion so the model discussion can distinguish a week-year from a calendar year.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
from datetime import date
def iso_week_date(year, week, weekday):
values = (year, week, weekday)
if any(type(x) is not int for x in values):
raise ValueError("integer components")
if not 1 <= year <= 9999:
raise ValueError("year range")
if not 1 <= week <= 53 or not 1 <= weekday <= 7:
raise ValueError("week or weekday range")
return date.fromisocalendar(year, week, weekday)