ProjectStructureManager is a Python project for creating folder and file structures exactly as the developer modeled the project.
The project has the following structure:
|--docs/
||--__init__.py
||--README_DE.md
||--README_RU.md
||--README_UA.md
|--psmanager/
||--__init__.py
||--project_structure_manager.py
|--tests/
||--__init__.py
||--test_psmanager.py
||--test_structure.json
|--LICENSE
|--main.py
|--README.md
|--requirements.txt
|--structure.json
Server: Python 3.9^
gh repo clone komanch7/projectstructuremanager psm-pro
cd psm-cli
or
git clone https://github.com/komanch7/projectstructuremanager psm-pro
cd psm-pro
python -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip
or
python3 -m pip install --upgrade pip
# main.py
from psmanager.project_structure_manager import ProjectStructureManager
if __name__ == "__main__":
path = "."
file_struct = "structure.json"
manager = ProjectStructureManager(path, file_struct)
manager.create_structure()
- If the requirements.txt file contains models, then enter the following command in the terminal
pip install -r requirements.txt
python -m unittest discover -s tests
>> test_create_structure (test_psmanager.TestProjectStructureManager) ... ok
>> test_create_structure_with_content (test_psmanager.TestProjectStructureManager) ... ok
>> test_load_structure_from_json (test_psmanager.TestProjectStructureManager) ... ok
>>
>> ----------------------------------------------------------------------
>> Ran 3 tests in 0.425s
>>
>> OK
python main.py
or
python3 main.py
- Command to deactivate the virtual environment upon completion of work
deactivate
{
"mypackage": {
"mypackage": {
"controllers": {
"__init__.py": "",
"control_one.py": "",
"control_two.py": "",
"control_three.py": "",
"control_four.py": ""
},
"__init__.py": "",
"models": {
"__init__.py": "",
"model_one.py": "",
"model_two.py": "",
"model_three.py": "",
"model_four.py": ""
}
},
"__init__.py": "# None",
"tests": {
"__init__.py": "",
"test_one.py": "",
"test_two.py": "",
"test_three.py": "",
"test_four.py": ""
},
"docs": {
"__init__.py": "",
"README.md": ""
},
"main.py": "# main()",
"requirements.txt": "# requirements.txt"
}
}
Folder and file structure for the future project:
|--mypackage/
||--mypackage/
|||--__init__.py
|||--controllers/
||||--__init__.py
||||--control_one.py
||||--control_two.py
||||--control_three.py
||||--control_four.py
|||--models/
||||--__init__.py
||||--model_one.py
||||--model_two.py
||||--model_three.py
||||--model_four.py
||--tests/
||||--__init__.py
||||--test_one.py
||||--test_two.py
||||--test_three.py
||||--test_four.py
||--__init__.py
||--docs/
||||--__init__.py
||||--README.md
||--main.py
||--requirements.txt
||--LICENSE
- I'm a beginner in Python development. Thank you for your understanding and support.