Project
cli.commands.project
Module for creating a new Hari project structure.
project(project_name)
Create a new project structure with the given name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name
|
str
|
The name of the project. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, List[str]]
|
Dict[str, List[str]]: A dictionary containing the created directories and files. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the template directory does not exist. |
PermissionError
|
If there are permission issues while creating files or directories. |
Exception
|
For any other unexpected errors. |
Examples:
>>> project("my_project")
{
"dirs_created": [
"my_project/configs",
"my_project/utils",
],
"files_created": [
"my_project/configs/configs.yaml",
"my_project/utils/helpers.py",
"my_project/utils/validators.py",
"my_project/job.py",
"my_project/README.md"
]
}
Source code in hari_data/cli/commands/project.py
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 | |