diff --git a/src/screener/user_input.py b/src/screener/user_input.py index b28a6d8..3c296ef 100644 --- a/src/screener/user_input.py +++ b/src/screener/user_input.py @@ -23,11 +23,42 @@ def get_interval_choice() -> str: return "1hour" else: print("Invalid choice. Please try again.") +def get_user_screener_selection() -> dict: + """Ask the user which screeners they want to run and whether to use defaults. + Returns a dictionary of selected screeners with default/customization choices. """ Ask the user which screeners they want to run and whether to use defaults. Returns a dictionary of selected screeners with default/customization choices. """ selected_screeners = {} + + print("\nAvailable Screener Categories:") + for category in SCREENERS: + print(f"- {category}") + + selected_categories = input("\nEnter the categories you want to screen (comma-separated), or type 'all' for all: ").strip().lower() + + if selected_categories == "all": + selected_categories = SCREENERS.keys() + else: + selected_categories = [c.strip().title() for c in selected_categories.split(",") if c.strip().title() in SCREENERS] + + for category in selected_categories: + print(f"\nCategory: {category}") + use_defaults = input(f"Use default settings for {category}? (y/n): ").strip().lower() + + selected_screeners[category] = {} + + for screener, description in SCREENERS[category].items(): + if use_defaults == "y": + selected_screeners[category][screener] = "default" + else: + custom_value = input(f"{screener} ({description}) - Enter custom threshold or press Enter to use default: ").strip() + selected_screeners[category][screener] = float(custom_value) if custom_value else "default" + + print(f"\nāœ… Selected Screeners: {selected_screeners}\n") # āœ… DEBUG LOG + + return selected_screeners print("\nAvailable Screener Categories:") for category in SCREENERS: