CLI launching
The main entry point for the DataForge toolkit.
This class orchestrates the Command Line Interface (CLI). It registers all available file operations, loads the global configuration, and manages the execution of specific tasks based on user input.
Attributes:
| Name | Type | Description |
|---|---|---|
parser |
ArgumentParser
|
The main CLI parser. |
subparsers |
_SubParsersAction
|
A collection of command-specific parsers. |
commands |
Dict[str, Type[FileOperation]]
|
A mapping of command names to their respective operation classes. |
settings |
AppSettings
|
The global configuration object loaded from JSON and environment variables. |
Source code in data_forge.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
__init__()
Initializes the DataForge application.
It sets up the argument parser, registers the list of supported commands, and loads the initial settings from the configuration file.
Source code in data_forge.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
execute()
Parses CLI arguments and executes the selected operation.
This method merges the input from the command line with the existing settings. It ensures that CLI arguments have the highest priority. Then, it creates an instance of the chosen operation and calls its 'run' method.
Source code in data_forge.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |