PythonNest / PyNest

PyNest is a Python framework built on top of FastAPI that follows the modular architecture of NestJS
https://pythonnest.github.io/PyNest
MIT License
643 stars 45 forks source link

Add HTTP Status Code Feature and Some Refactors #66

Closed AmirLavasani closed 2 weeks ago

AmirLavasani commented 4 weeks ago

Add HTTP Status Code Feature and Some Refactors

Description

This merge request includes various refactorings, documentation improvements, and a new feature addition to the PyNest framework. Below are the detailed changes:

Changes Made:

  1. Code Formatting and Cleanup:

    • Reformatted all files using black for consistent code style.
    • Removed unused and redundant code for better maintainability.
  2. Refactoring:

    • Introduced HTTPMethod enum for route decorators to enhance readability and maintainability.
    • Simplified PyNestFactory class and added docstrings to improve clarity and readability of the code.
    • Refactored the HTTPCode decorator to streamline its functionality.
  3. Documentation:

    • Added docstrings throughout the codebase wherever additional description was required to improve readability and understanding.
    • Fixed minor documentation issues to ensure accuracy and completeness.
  4. New Feature: HTTP Status Code Decorator:

    • Added a new feature allowing the use of @HTTPCode decorator.
    • This feature enables sending HTTP responses with specified status codes easily.

Please review the changes and provide feedback. Thanks

ItayTheDar commented 4 weeks ago

Hi @AmirLavasani

Thank you for this pull request. I am truly appreciate your code contribution to pynest.

I'll go over the pr asap and added comments if needed 🫡

AmirLavasani commented 3 weeks ago

Thanks @ItayTheDar

Well done on PyNest, it is a very cool idea, and the current Python ecosystem lacks a modular backend framework.

I've started reading through the codebase and am working on adding documentation and making simple refactors to improve PyNest's readability and maintainability. I hope I can help PyNest reach its full potential. 🫡

ItayTheDar commented 2 weeks ago

@AmirLavasani Hi!

I've noticed some unwanted behaviour so i pushed a fix.

When we define the HTTP decorators as lambda functions, the ide raises some issue when trying to add the different kwargs to the route (response_model, description and etc...)

image