πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

structura-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

structura-py

Structura is a CLI tool that automates folder structure generation and dependency management for Python projects. It supports multiple architectures (MVC, MVCS, Hexagonal) and frameworks (Flask, FastAPI), using YAML configuration for flexibility.

1.0.1
PyPI
Maintainers
1

Structura

Automated Folder Structure & Dependency Management for Python Projects

Overview

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

Features

  • Multiple Architectures: MVC, MVCS, Hexagonal, and more
  • Auto-Generates Folders & Boilerplate Files
  • Dependency Management: Supports venv, pipenv, and poetry
  • YAML Configuration for flexible project initialization
  • Extensible: Easily customize folder structures and dependencies
  • Cross-Platform Compatibility: Works on Windows, Linux, and macOS

Installation

You can install Structura using pip:

pip install structura-py

Usage

Initialize a New Project

Create a new Python project with the desired architecture:

structura init myproject --framework flask

For FastAPI:

structura init myproject --framework fastapi

Generate Project Files

If you already have a project, you can simply generate the structure:

structura init

Folder Structure Example

When 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, routes
  • MVCS: Adds services layer for business logic separation
  • Hexagonal: Adds adapters and ports folders for dependency inversion

Contributing

We welcome contributions! To contribute:

  • Fork the repository
  • Create a new feature branch
  • Commit your changes
  • Open a Pull Request (PR)

License

Structura is licensed under the MIT License. Feel free to use, modify, and distribute it.

Feedback & Issues

If you encounter any issues or have suggestions, feel free to open an issue on GitHub.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts