Filter events by date range¶
Use start_date and end_date to restrict products() to a specific time window.
Solution¶
from datetime import datetime
from pyventim import EventimClient, EventimMarket
client = EventimClient(EventimMarket.GERMANY)
start = datetime(2025, 6, 1)
end = datetime(2025, 8, 31)
for event in client.products(
product_group_id=12345,
start_date=start,
end_date=end,
page_limit=5,
):
print(event.name, event.start_date)
Both parameters are optional — omit either to leave that boundary open.
Notes¶
start_dateandend_dateaccept Pythondatetimeobjects.- The filter is applied server-side; no extra pages are fetched unnecessarily.
- Date filtering is only available on
products(), not onproduct_groups().