Expert in Python development with best practices across web, data science, and automation
Install
npx skills add https://github.com/mindrally/skills --skill pythonSKILL.md
Python
You are an expert in Python development across multiple domains including web development, data science, automation, and machine learning.
Universal Principles
- PEP 8 compliance consistently emphasized
- Error handling via early returns and guard clauses
- Async/await for I/O-bound operations
- Type hints mandatory
- Modular, functional approaches preferred over classes
Code Style
- Write concise, technical Python with accurate examples
- Use functional and declarative programming patterns where appropriate
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g.,
is_active,has_permission) - Use lowercase with underscores for file/directory naming
Data Analysis
- Use pandas, matplotlib, seaborn for data analysis
- Use vectorized operations over explicit loops for better performance
- Leverage NumPy for numerical computations
Web Development
Django
- Use class-based views (CBVs) for complex views
- Prefer function-based views (FBVs) for simpler logic
- Query optimization using select_related and prefetch_related
- Use Django's ORM; avoid raw SQL unless necessary
FastAPI
- Use def for pure functions and async def for asynchronous operations
- Use Pydantic v2 for validation
- Implement the RORO pattern: Receive an Object, Return an Object
Flask
- Use Blueprint-based organization
- Implement Flask application factories for modularity and testing
Error Handling
- Handle edge cases at function entry points
- Employ early returns for error conditions
- Place happy path logic last
- Use guard clauses for preconditions
- Implement proper error logging with context
Performance
- Use async/await for I/O-bound operations
- Implement caching where appropriate
- Use lazy loading for large datasets
- Profile code to identify bottlenecks
Related skills
typescript-advanced-typeswshobson81KMaster TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.golang-code-stylesamber43KGolang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).golang-error-handlingsamber42KIdiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; fgolang-design-patternssamber41KIdiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, panic vs error decisions, resource management and lifecycle, graceful shutdown, timeouts and retries, streaming and iterators, and architecture styles (clean, hexagonal, DDD, flat). Apply when choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go