I need help creating a Python script for a specific task. Please generate a well-structured, commented Python script based on my requirements.
SCRIPT DETAILS:
- Purpose: [DESCRIBE THE TASK OR FUNCTION]
- Input: [WHAT DATA WILL THE SCRIPT RECEIVE]
- Output: [WHAT SHOULD THE SCRIPT PRODUCE]
- Required functionality: [SPECIFIC FEATURES NEEDED]
- Python version: [VERSION IF SPECIFIC]
- Libraries/dependencies: [ANY REQUIRED LIBRARIES]
- Execution environment: [WHERE WILL THIS RUN]
Please create a Python script that:
1. STRUCTURE & STYLE
* Follows PEP 8 style guidelines
* Includes proper docstrings and comments
* Uses meaningful variable and function names
* Implements proper error handling
* Is organized into logical functions/classes
* Includes a main execution block with if __name__ == "__main__"
2. CORE FUNCTIONALITY
* Implements all required features
* Handles edge cases and potential errors
* Uses efficient algorithms and approaches
* Processes inputs correctly
* Produces the expected outputs
* Includes validation where appropriate
3. CODE QUALITY
* Is readable and maintainable
* Avoids unnecessary complexity
* Uses Python idioms and best practices
* Includes appropriate type hints (if using Python 3.6+)
* Follows the principle of least surprise
4. DOCUMENTATION
* Includes a header explaining the script's purpose
* Documents parameters, return values, and exceptions
* Provides examples of usage
* Explains any complex algorithms or logic
* Notes any limitations or assumptions
5. ADDITIONAL CONSIDERATIONS
* Performance optimizations where relevant
* Security considerations if applicable
* Suggestions for future improvements or extensions
* Alternative approaches if there are multiple ways to solve
Please provide the complete, ready-to-run Python script with all necessary imports and code to accomplish the described task.