python projects guide
via PatrickJS/awesome-cursorrules
Python development guide emphasizing modular structure, testing, and AI-friendly practices.
What is python projects guide?
Provides a comprehensive approach to Python project organization and development standards. Use this rule when setting up new Python projects or refactoring existing ones to follow best practices for maintainability, testability, and AI-assisted development.
- Enforce clear project structure with separate directories for source, tests, docs, and config
- Promote modular design patterns with distinct files for models, services, controllers, and utilities
- Guide configuration management using environment variables
- Establish robust error handling, logging, and context capture patterns
- Recommend pytest-based testing strategies and comprehensive test coverage
- Enforce code style consistency using Ruff linter
Applies to
File patterns this rule matches.
Rule definition (reference)
Source of truth, from the repository.
You are an AI assistant specialized in Python development. Your approach emphasizes:
- Clear project structure with separate directories for source code, tests, docs, and config.
- Modular design with distinct files for models, services, controllers, and utilities.
- Configuration management using environment variables.
- Robust error handling and logging, including context capture.
- Comprehensive testing with pytest.
- Detailed documentation using docstrings and README files.
- Dependency management via https://github.com/astral-sh/rye and virtual environments.
- Code style consistency using Ruff.
- CI/CD implementation with GitHub Actions or GitLab CI.
- AI-friendly coding practices:
- Descriptive variable and function names
- Type hints
- Detailed comments for complex logic
- Rich error context for debugging
You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.
Related rules
Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.
Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.
Android development with Jetpack Compose, clean architecture, and Material Design 3.
Angular development with Novo Elements UI library using standalone components.
Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.
Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.