Automated Folder Structure & Dependency Management for Python Projects
Structura is a powerful project scaffolding tool designed to automate the creation of consistent and standardized folder structures for Python projects. It supports multiple frameworks and architectures, making it easy to initialize production-ready projects with just a few commands.
Whether you're building a Flask or FastAPI project, Structura handles:
- Folder structuring
- Dependency installation
- Environment setup
- Custom configurations via YAML
- Multiple Architectures: MVC, MVCS, Hexagonal, and more
- Auto-Generates Folders & Boilerplate Files
- Dependency Management: Supports
venv,pipenv, andpoetry - YAML Configuration for flexible project initialization
- Extensible: Easily customize folder structures and dependencies
- Cross-Platform Compatibility: Works on Windows, Linux, and macOS
You can install Structura using pip:
pip install structura-pyCreate a new Python project with the desired architecture:
structura init myproject --framework flaskFor FastAPI:
structura init myproject --framework fastapiIf you already have a project, you can simply generate the structure:
structura initWhen you run structura-py init, it generates the following folder structure based on the chosen architecture (e.g., MVC):
/myproject ├── app │ ├── __init__.py │ ├── models │ │ └── user.py │ ├── services │ │ └── user_service.py │ ├── controllers │ │ └── user_controller.py │ ├── routes │ │ └── user_routes.py ├── config │ ├── settings.py │ └── config.yaml ├── tests │ ├── test_user.py ├── requirements.txt ├── .env ├── README.md └── main.py Architecture Variations:
MVC:models,services,controllers,routesMVCS: Addsserviceslayer for business logic separationHexagonal: Addsadaptersandportsfolders for dependency inversion
We welcome contributions! To contribute:
- Fork the repository
- Create a new feature branch
- Commit your changes
- Open a Pull Request (PR)
Structura is licensed under the MIT License. Feel free to use, modify, and distribute it.
If you encounter any issues or have suggestions, feel free to open an issue on GitHub.