department-for-transport-BODS / bods-data-extractor

A python client for downloading and extracting data from the UK Bus Open Data Service
Other
44 stars 8 forks source link

TimeTable Extractor reports 'Fetching zip/xml file' twice #23

Closed spencer-b-318 closed 1 year ago

spencer-b-318 commented 1 year ago

If stop_level = True, after printing 'merging files...', console prints 'fetching zip file from [url]' and 'following URLs failed' twice. Could be downloading twice as well.

To Reproduce Steps to reproduce the behavior:

  1. Set stop_level = True
  2. Run for any number of datasets
  3. observe behaviour in console
  4. code example

    timetable_ = TimetableExtractor(api_key=api # Your API Key Here
                                 ,limit=1 # How many datasets to view
                                 ,status = 'published' # Only view published datasets
                                 ,service_line_level=True # True if you require Service line data 
                                 ,stop_level=True # True if you require stop level data
    
                               )

Expected behavior code should only download and print file once, even if stop_level and service_line_level are set to True. This is a waste of compute otherwise

image

adamakram1 commented 1 year ago

Downloads and prints file once, even if stop_level and service_line_level are both true

adamakram1 commented 1 year ago
console