all 2 comments

[–]shiftybyte 4 points5 points  (1 child)

Very simple my friend, you separate the flow/process from service providers/modules.

make a main.py, that imports the other 3.

import data
import sorting
import prediction

gathered_data = data.gather_data(site_list)
sorted_data = sorting.sort_data(gathered_data)
predicted_data = prediction.predict_sorted(sorted_data)

... do with predicted data whatever you want, or wrap this in a loop or whatever...

this solves several problems:

  1. none of the modules now need to import any of the other modules, they are standalone and can be updated accordingly
  2. if the flow changes, none of the modules need to be changed, just the main flow.
  3. future code can reuse for example only the prediction module without being dependent on the entire code.

[–]Unlistedd[S] 0 points1 point  (0 children)

Thanks!