[One-sentence description of what this module does and why it exists]
[Brief explanation of the module's organization philosophy]
module-name/
├── __init__.py # [Purpose - e.g., Public API exports]
├── base.py # [Purpose - e.g., Shared constants and imports]
├── core.py # [Purpose - e.g., Core functionality]
├── utils.py # [Purpose - e.g., Helper functions]
└── submodule/ # [Purpose - e.g., Specialized functionality]
├── __init__.py
└── implementation.py
- [Description of what this module provides]
- Key exports:
CONSTANT_NAME- [Purpose]function_name()- [Purpose]
- [Description of core functionality]
- Key functions:
primary_function()- [Purpose and usage]secondary_function()- [Purpose and usage]
- [Description of utility functions]
- Key utilities:
helper_function()- [Purpose]validation_function()- [Purpose]
The [module-name] module exports a clean public API:
from [module_name] import (
# Main functions
primary_function,
secondary_function,
# Utilities
helper_function,
validation_function,
# Constants
IMPORTANT_CONSTANT,
)[Explanation of how old imports continue to work, or note if this is a new module]
Example:
# Old code still works
from [old_module] import primary_function
# New code can use modular imports
from [module_name].core import primary_functionAll existing imports continue to work without changes.
- Separation of Concerns: [How responsibilities are divided]
- Maintainability: [Why it's easier to maintain]
- Testability: [How it improves testing]
- Backwards Compatible: [If applicable - how old code continues to work]
- Scalability: [How it supports future growth]
core.py
├── utils.py (helper functions)
└── base.py (constants, logging)
submodule/implementation.py
├── core.py (main functionality)
└── utils.py (validation)
from [module_name] import primary_function
# Example usage
result = primary_function(arg1, arg2)from [module_name].core import CoreClass
from [module_name].utils import helper_function
# Example of advanced usage
instance = CoreClass(config)
processed = helper_function(instance.data)Run the test suite to verify the module:
# Run all module tests
pytest tests/test_[module_name].py -v
# Run specific test
pytest tests/test_[module_name].py::test_function_name -vThis verifies:
- [What aspect is tested]
- [What aspect is tested]
- [What aspect is tested]
# Use focused imports for clarity
from [module_name].core import primary_function
from [module_name].utils import helper_function# Old imports continue to work (if backwards compatible)
from [old_module] import primary_function| Variable | Required | Default | Description |
|---|---|---|---|
CONFIG_VAR |
Yes | - | [Purpose] |
OPTIONAL_VAR |
No | value |
[Purpose] |
Example .env:
CONFIG_VAR=value
OPTIONAL_VAR=custom_value- [Planned enhancement 1]
- [Planned enhancement 2]
- [Known limitation to address]
Symptom: [What users see]
Solution:
# How to fix itTemplate Version: 1.0 Last Updated: [YYYY-MM-DD] Maintainer: [Team/Person responsible for this module]