A modern, modular Python framework inspired by NestJS, built on top of FastAPI.
Organize your code into reusable modules for better scalability and maintainability.
Leverage the speed and performance of FastAPI, one of the fastest Python web frameworks.
Enjoy robust type checking and autocomplete features with Python's type hints.
Join a growing community of developers contributing to the evolution of PyNest.
Easily integrate with various libraries and tools to extend functionality.
Implement best security practices with built-in support for authentication and authorization.
from nest.core import PyNestFactory, Module, Controller, Get, Injectable
@Injectable()
class AppService:
def __init__(self):
self.app_name = "PyNest App"
self.app_version = "1.0.0"
def get_app_info(self):
return {"app_name": self.app_name, "app_version": self.app_version}
@Controller("/")
class AppController:
def __init__(self, app_service: AppService):
self.app_service = app_service
@Get("/")
def get_app_info(self):
return self.app_service.get_app_info()
@Module(controllers=[AppController], providers=[AppService])
class AppModule:
pass
app = PyNestFactory.create(
AppModule,
description="This is my PyNest app.",
title="PyNest Application",
version="1.0.0",
debug=True,
)