Package: pynest-api
PyNest is a Python framework built on top of FastAPI that follows the modular architecture of NestJSDescriptionPyNest is designed to help structure your APIs in an intuitive, easy to understand, and enjoyable way.With PyNest, you can build scalable and maintainable APIs with ease. The framework supports dependency injection, type annotations, decorators, and code generation, making it easy to write clean and testable code.This framework is not a direct port of NestJS to Python but rather a re-imagining of the framework specifically for Python developers, including backend engineers and ML engineers. It aims to assist them in building better and faster APIs for their data applications.Getting StartedTo get started with PyNest, you'll need to install it using pip:pipinstallpynest-apiStart with clipynestcreate-nest-app-nmy_app_namethis command will create a new project with the following structure:├── app.py
├── main.py
├── requirements.txt
├── .gitignore
├── README.md
├── src
│    ├── __init__.pyonce you have created your app, get into the folder and run the following command:cdmy_app_namerun the server with the following command:uvicorn"app:app"--host"0.0.0.0"--port"8000"--reloadNow you can visitOpenAPIin your browser to see the default API documentation.Adding modulesTo add a new module to your application, you can use the pynest generate module command:pynestgmodule-nusersThis will create a new module calledusersin your application with the following structure under thesrcfolder:├── users
│    ├── __init__.py
│    ├── users_controller.py
│    ├── users_service.py
│    ├── users_model.py
│    ├── users_entity.py
│    ├── users_module.pyThe users module will immediately register itself with the application and will be available for use.You can then start defining routes and other application components using decorators and other PyNest constructs.For more information on how to use PyNest, check out the official documentation athttps://pythonnest.github.io/PyNest/.PyNest CLI Usage GuideThis document provides a guide on how to use the PyNest Command Line Interface (CLI). Below are the available commands and their descriptions:pynestCommandDescription: The main command group for PyNest CLI.create-nest-appSubcommandDescription: Create a new nest app.Options:--app-name/-n: The name of the nest app (required).--db-type/-db: The type of the database (optional). You can specify PostgreSQL, MySQL, SQLite, or MongoDB.--is-async: Whether the project should be asynchronous (optional, default is False).gcommand groupDescription: Group command for generating boilerplate code.moduleSubcommandDescription: Generate a new module (controller, service, entity, model, module).Options:--name/-n: The name of the module (required).CLI Examplescreate a blank nest application -pynest create-nest-app -n my_app_namecreate a nest application with postgres database and async connection -pynest create-nest-app -n my_app_name -db postgresql --is-asynccreate new module -pynest g module -n usersKey FeaturesModular ArchitecturePyNest follows the modular architecture of NestJS, which allows for easy separation of concerns and code organization. Each module contains a collection of related controllers, services, and providers.Dependency InjectionPyNest supports dependency injection, which makes it easy to manage dependencies and write testable code. You can easily inject services and providers into your controllers using decorators.DecoratorsPyNest makes extensive use of decorators to define routes, middleware, and other application components. This helps keep the code concise and easy to read.Type AnnotationsPyNest leverages Python's type annotations to provide better tooling and help prevent errors. You can annotate your controllers, services, and providers with types to make your code more robust.Code GenerationPyNest includes a code generation tool that can create boilerplate code for modules, controllers, and other components. This saves you time and helps you focus on writing the code that matters.Future PlansCreate plugins Marketplace for modules where developers can share their modules and download modules created by others.Implement IOC mechanism and introduce Module decoratorAdd support for new databasesCreate out-of-the-box authentication module that can be easily integrated into any application.Add support for other testing frameworks and create testing templates.Add support for other web frameworks (Flask, Django, etc.) - Same Architecture, different engine.ContributingContributions are welcome! Please feel free to grab one of the open issues,
or open a new one if you have an idea for a new feature or improvement.This would bring a huge impact to the project and the community.LicensePyNest isMIT licensed.CreditsPyNest is inspired byNestJS.