python-patterns
Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.
npx skills add mturac/everything-openai-codex --skill python-patterns --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Python Development Patterns Idiomatic Python patterns and best practices for building robust, efficient, and maintainable applications. ## When to Activate - Writing new Python code - Reviewing Python code - Refactoring existing Python code - Designing Python packages/modules ## Core Principles ### 1. Readability Counts Python prioritizes readability. Code should be obvious and easy to understand. ```python # Good: Clear and readable def get_active_users(users: list[User]) -> list[User]: """Return only active users from the provided list.""" return [user for user in users if user.is_active] # Bad: Clever but confusing def get_active_users(u): return [x for x in u if x.a] ``` ### 2. Explicit is Better Than Implicit Avoid magic; be clear about what your code does. ```python # Good: Explicit configuration import logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) # Bad: Hidden side effects import some_module some_module.setup() # What does this do? ``` ### 3. EAFP - Easier to Ask Forgiveness Than Permission Python prefers exception handling over checking conditions. ```python # Good: EAFP style def get_value(dictionary: di
- When to Activate
- Core Principles
- 1. Readability Counts
- 2. Explicit is Better Than Implicit
- 3. EAFP - Easier to Ask Forgiveness Than Permission
- Type Hints
- Basic Type Annotations
- Modern Type Hints (Python 3.9+)
- Type Aliases and TypeVar
- Protocol-Based Duck Typing
- Error Handling Patterns
- Specific Exception Handling
- Exception Chaining
- Custom Exception Hierarchy
Code formatting black . isort . Linting ruff check . pylint mypackage/ Type checking mypy . Testing pytest --cov=mypackage --cov-report=html
What does the python-patterns skill do?
Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill python-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
