coding-python

Enforces PEP 8, pathlib usage, Google-style docstrings, pytest tests, and ruff/mypy static checks for Python projects.

4|Updated Jan 16, 2019
One-click install
npx skills add https://github.com/four43/dotfiles --skill coding-python-four43
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-python
Source: https://github.com/four43/dotfiles/tree/main/claude/skills/coding-python
Command: npx skills add https://github.com/four43/dotfiles --skill coding-python-four43

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python coding guidelines streamline writing clean, idiomatic Python code, ensuring consistency, readability, and maintainability across projects and teams.

Core Features & Use Cases

  • PEP 8-compliant style guidelines with practical examples for naming, formatting, and project layout.
  • Use of pathlib.Path objects instead of strings for file paths, plus type hints for all public APIs.
  • Google-style docstrings for public functions and classes, with signatures carrying type information.
  • Testing and quality: pytest-based tests, parameterization, and linting/type-checking with ruff and mypy.

Quick Start

Apply these guidelines to your Python project to start writing clean, idiomatic code today.

Frequently Asked Questions about coding-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write clean Python code that follows PEP 8 standards?

To write clean Python code following PEP 8, apply guidelines for naming, formatting, and project layout. Use pathlib.Path objects for file paths, add type hints to public APIs, and document functions with Google-style docstrings to ensure readability.

What's the best way to set up Python testing with pytest and parameterization?

The best way to set up Python testing is using pytest with parameterization. This approach allows you to write structured tests that cover multiple inputs efficiently, ensuring your Python project maintains high quality and correctness across various scenarios.

How do you write Google-style docstrings for Python public functions?

Google-style docstrings for Python public functions require clear descriptions paired with type hints in the function signature. This combination ensures all public APIs carry explicit type information, streamlining code reviews and improving overall project maintainability.

Can I use ruff and mypy together for Python static checks?

Yes, you can use ruff and mypy together for Python static checks. Ruff handles linting to enforce style guidelines, while mypy validates type hints across your codebase, ensuring both stylistic consistency and type safety.

Why use pathlib.Path instead of string paths in Python projects?

Use pathlib.Path instead of string paths in Python projects to handle filesystem operations safely and cleanly. Path objects provide a consistent, object-oriented interface for path manipulation, reducing errors and ensuring idiomatic code structure.