coding-standard-python
Installation
SKILL.md
Python Coding Standards (PEP 8)
When reviewing or generating Python code, follow these rules:
File Naming
- Source files: Use snake_case (e.g.,
user_service.py,api_client.py) - Package directories: Use snake_case (e.g.,
data_processing/,utils/) - Test files: Use
test_prefix (e.g.,test_user_service.py) - Config files: Use snake_case (e.g.,
config_settings.py)
Variable Naming
- Variables: snake_case (e.g.,
user_name,is_active,total_count) - Constants: UPPER_SNAKE_CASE (e.g.,
MAX_RETRIES,API_BASE_URL) - Boolean variables: Prefix with
is_,has_,can_,should_(e.g.,is_loading,has_error) - Protected variables: Single underscore prefix (e.g.,
_internal_data) - Private variables: Double underscore prefix (e.g.,
__private_data)