ciaranmccormick / python-bods-client

A python client for the Bus Open Data Service API
MIT License
21 stars 3 forks source link

Only last Admin Area being considered by Timetable API #40

Closed mullinscr closed 1 year ago

mullinscr commented 1 year ago

As per #29, admin areas passed in as parameters are not being interpreted properly by the API -- just the last value gets used. See example below:

from bods_client.client import BODSClient
from bods_client.models import TimetableParams

bc = BODSClient(api_key)

single_areas_params = TimetableParams(admin_areas=['260'], limit=1_000)
single_areas_results = len(bc.get_timetable_datasets(single_areas_params).results)

multiple_areas_params = TimetableParams(admin_areas=['269', '260'], limit=1_000)
multiple_areas_results = len(bc.get_timetable_datasets(multiple_areas_params).results)

print(single_areas_results == multiple_areas_results)

>> True