graph LR
CLI_Entry_Point["CLI Entry Point"]
Project_Initializer["Project Initializer"]
Config_File_Generator["Config File Generator"]
ASGI_App_Scaffolder["ASGI App Scaffolder"]
ASGI_Server_Selector["ASGI Server Selector"]
ASGI_Router_Selector["ASGI Router Selector"]
Piccolo_App_Creator["Piccolo App Creator"]
Core_App_Logic["Core App Logic"]
CLI_Entry_Point -- "dispatches commands to" --> Project_Initializer
CLI_Entry_Point -- "dispatches commands to" --> ASGI_App_Scaffolder
CLI_Entry_Point -- "dispatches commands to" --> Piccolo_App_Creator
Project_Initializer -- "invokes" --> Config_File_Generator
ASGI_App_Scaffolder -- "queries" --> ASGI_Server_Selector
ASGI_App_Scaffolder -- "queries" --> ASGI_Router_Selector
Piccolo_App_Creator -- "delegates to" --> Core_App_Logic
The CLI & Project Management subsystem in Piccolo is defined by piccolo/main.py, piccolo/apps/project/commands/new.py, and piccolo/apps/asgi/commands/new.py. It handles user interaction, project setup, and command dispatching. The identified components are crucial for Piccolo's core functionalities as an ORM and an ASGI application scaffolder, enabling users to initiate, configure, and extend their Piccolo-based applications through project initialization, configuration file generation, ASGI application scaffolding, and modular Piccolo app creation.
The primary command-line interface for Piccolo. It parses user commands and dispatches control to the appropriate command handler. This component is fundamental as it's the user's initial interaction point with the framework.
Related Classes/Methods:
Manages the setup of a new Piccolo project, including the creation of the initial directory structure and the essential piccolo_conf.py configuration file. This is crucial for establishing the foundation of any Piccolo-based application.
Related Classes/Methods:
Specifically handles the generation of the piccolo_conf.py file, which is critical for defining database connections, ORM applications, and other core configurations for Piccolo. This component directly supports Piccolo's role as an ORM by setting up its core configuration.
Related Classes/Methods:
Automates the scaffolding of new ASGI web applications within a Piccolo project, guiding the user through choices for the ASGI server and routing framework, and generating the necessary boilerplate code. This component highlights Piccolo's integration capabilities with web frameworks, a key aspect of its architectural bias.
Related Classes/Methods:
Interacts with the user to prompt for and capture their preferred ASGI server choice during the ASGI application scaffolding process. This component ensures user-driven customization of the scaffolded application.
Related Classes/Methods:
Interacts with the user to prompt for and capture their preferred routing framework for the ASGI application being scaffolded. Similar to the server selector, this allows for tailored application generation.
Related Classes/Methods:
Orchestrates the creation of new, modular Piccolo applications, including setting up their dedicated directories and initial files, and ensuring valid naming conventions. These "Piccolo apps" represent distinct, reusable modules within a larger project, aligning with the modularity architectural pattern.
Related Classes/Methods:
Encapsulates the fundamental logic for creating a new Piccolo application, including validation of the application name and checking for existing modules. This ensures the integrity and correctness of newly created Piccolo apps.
Related Classes/Methods: