Python API PEP 8 .cursorrules prompt file
About .cursorrules prompt file
What you can build
API Client Generator for Python: Create a tool that automatically generates well-structured and highly efficient Python API clients based on user-provided API documentation or endpoints. It will use PEP 8 naming conventions, modularize code, and include performance optimizations and unit tests.
Python Code Optimizer: Develop a web application that takes Python code as input and returns an optimized version, highlighting potential improvements such as performance bottlenecks, better variable naming, and adhering to PEP 8 standards.
API Performance Monitor: Develop a service that monitors API interactions in Python applications, providing insights and suggestions for optimization. The tool will analyze request durations, response times, and error rates while suggesting code improvements in line with Python best practices.
Python Coding Style Checker: Build an extension or standalone app that checks Python code for adherence to PEP 8 standards and best practices, offering suggestions for improvement. It will particularly focus on ensuring natural variable names, concise iterations, and modular design.
Modular Code Builder: Create a tool that assists developers in constructing Python applications with a focus on code modularization, helping to identify duplicate code blocks and suggesting ways to refactor them into reusable functions or classes.
Unit Test Generator for API Clients: Design an application that automatically generates unit test cases for Python API clients. The tool will ensure that all critical functions and methods are tested, adhering to best practices in test-driven development.
Python Performance Audit Tool: Establish a service that audits Python applications for performance issues, analyzing code efficiency and providing actionable recommendations to enhance speed and resource utilization, following Python code best practices.
Descriptive Naming Advisor: Implement an interactive web tool that offers suggestions for improving variable names in Python code, ensuring they are descriptive and follow auxiliary verb recommendations per PEP 8 standards.
Python Modularization Assistant: Develop a widget or plugin that integrates with popular IDEs, guiding developers in refactoring their code to reduce duplication and increase modularization, ensuring cleaner and more maintainable codebases.
API Code Template Library: Create a repository or online platform offering a collection of templated Python code snippets for various APIs, showcasing best practices in performance, naming conventions, and unit testing.
Benefits
- Craft succinct and clear code prioritizing iteration and modularity over redundancy.
- Employ descriptive, action-oriented variable names consistent with PEP 8 standards.
- Implement unit tests to maintain code quality and performance efficiency.
Synopsis
Python developers can leverage this prompt to build high-performance, clean, and testable API clients while adhering to PEP 8 standards.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines for writing Python code, particularly for developing API clients. It emphasizes best practices such as creating clean, efficient, and readable code using iteration and modularization over duplication, following PEP 8 naming conventions, and performance optimization to make applications fast and efficient. Additionally, it highlights the importance of writing unit tests to ensure code quality. The file is tailored to aid developers in prioritizing user-centric design while maintaining high standards in code structure and performance.