Skip to content

REPL

REPL(Read-Eval-Print-Loop) is a simple interactive environment that takes single user inputs, executes them, and returns the result to the user. The REPL feature lets you inspect your dependency graph and call methods on your providers (and controllers) directly from your terminal.

Usage

To run your Nestipy application in REPL mode, run the following command in root of your project:

Bash
$ nestipy repl

Once it's up and running, you should see the following message in your console:

Bash
Nestipy REPL

>>> 

And now you can start interacting with your dependencies graph. For instance, you can retrieve an AppService (we are using the starter project and call the get() method for example:

Python
>>> await get(AppService).get()
'test'

To display all public methods available on a given provider or controller, use the methods() function, as follows:

Python
>>> methods(AppService)
AppService:
  delete
  get
  post
  put
To print all registered modules as a list together with their controllers and providers, use debug().

Python
>>> debug(AppModule)
AppModule:
  - Controllers:
     AppController
  - Providers:
     AppService

Support us

Nestipy is a project released under the MIT license, meaning it's open source and freely available for use and modification. Its development thrives with the generous contributions of these fantastic individuals.