python-style

hoelzro's avatarfrom hoelzro

Python coding conventions and best practices. Use when writing, reviewing, or refactoring Python code, or when working with Python scripts and projects.

⭐9stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025⬇️1downloads

When & Why to Use This Skill

This Claude skill serves as a comprehensive guide for Python coding conventions and industry best practices. It helps developers maintain high code quality, ensure PEP 8 compliance, and implement modern dependency management workflows using tools like 'uv'. By providing actionable advice during the writing, reviewing, and refactoring stages, it significantly reduces technical debt and improves codebase maintainability.

Use Cases

  • Standardizing Team Workflows: Use the skill to enforce consistent Python style guides across collaborative projects, making code reviews faster and more effective.
  • Modern Dependency Management: Leverage 'uv run' patterns to execute scripts with isolated, version-pinned dependencies without the overhead of manual virtual environment management.
  • Legacy Code Refactoring: Systematically identify and update non-idiomatic Python code to follow modern standards and improved performance patterns.
  • Automated Quality Assurance: Integrate style checks and best practice recommendations into the development lifecycle to catch potential issues before they reach production.
namepython-style
descriptionPython coding conventions and best practices. Use when writing, reviewing, or refactoring Python code, or when working with Python scripts and projects.

Python Style

Personal coding conventions for writing Python code.

Dependency Management

Running Scripts with Dependencies

Use uv run to execute Python scripts with temporary dependencies without modifying the environment:

uv run --with DEPENDENCY==VERSION script.py

Examples:

# Run a script with a specific version of requests
uv run --with requests==2.31.0 fetch_data.py

# Run with multiple dependencies
uv run --with requests==2.31.0 --with pandas==2.1.0 analyze.py

Benefits:

  • No need to create virtual environments for quick scripts
  • Dependencies are isolated and don't affect the system Python
  • Version pinning ensures reproducibility