Skip to content

Repository files navigation

Typing SVG

🔥 My Stats:

GitHub Streak

projectstructuremanager

ProjectStructureManager is a Python project for creating folder and file structures exactly as the developer modeled the project.

ProjectStructureManager Structure

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

Tech Stack

Server: Python 3.9^


Clone this repository

gh repo clone komanch7/projectstructuremanager psm-pro
cd psm-cli
or
git clone https://github.com/komanch7/projectstructuremanager psm-pro
cd psm-pro

Create and activate a virtual environment

python-mvenvvenvvenv\Scripts\activatepython-mpipinstall--upgradepiporpython3-mpipinstall--upgradepip

Usage

# main.pyfrompsmanager.project_structure_managerimportProjectStructureManagerif__name__=="__main__":
path="."file_struct="structure.json"manager=ProjectStructureManager(path, file_struct)
manager.create_structure()

Installing modules from requirements.txt

  • If the requirements.txt file contains models, then enter the following command in the terminal
pip install -r requirements.txt

Command to run tests

python -m unittest discover -s tests 

Response

>> 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

Create the structure

pythonmain.pyorpython3main.py

Deactivate environment

  • Command to deactivate the virtual environment upon completion of work
deactivate

JSON test project model

{
"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"
}
}

Test Structure

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

🚀 About Me

  • I'm a beginner in Python development. Thank you for your understanding and support.

License

MIT

About

ProjectStructureManager is a Python project for creating folder and file structures exactly as the developer modeled the project.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages