acmpesuecc/Consoles_India_StockNotifier

Refactor Configuration files to External Config File

Open

#2 opened on Oct 17, 2024

 (21 comments) (0 reactions) (1 assignee)Python (3 forks)auto 404
Bounty: 50good first issue

Repository metrics

Stars
 (0 stars)
PR merge metrics
 (PR metrics pending)

Description

Currently, the main config, product and website configurations are hardcoded, making it difficult to manage and update. We should refactor this into a separate configuration file to improve maintainability, reduce clutter in the code, and allow for easier updates in the future.

Proposed Solution:

  • Create an external configuration file (e.g., config.yaml) to store product information.
  • Modify the Python code to load product details from these configuration file instead of hardcoding them in the Python file.

Files to be refactored

Steps to Implement:

  1. Create a new configuration file (e.g., products_config.yaml and website_config.yaml).
  2. Move all product/website data into this configuration file.
  3. Modify the existing Python file to parse and load the configuration at runtime.
  4. Test to ensure that functionality remains the same and all products are correctly loaded from the configuration file.

Additional Considerations:

  • Ensure that the configuration file format is easy to update.
  • Document the new configuration file format and explain how to add or update products.

Benefits:

  • Improved maintainability.
  • Reduced code duplication.
  • Easier to update or add new products without modifying Python code directly.

Contributor guide