Skip to main content

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.

Project description

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:

  1. Fork the repository
  2. Create a new feature branch
  3. Commit your changes
  4. 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.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structura_py-1.0.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structura_py-1.0.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file structura_py-1.0.2.tar.gz.

File metadata

  • Download URL: structura_py-1.0.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for structura_py-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ef3ea3f8b20f1bcb07edfef5cf5f1bd83491e4c9d96222c0f6f3864561d45514
MD5 252c82f01f69e7b5504f5edd1826c026
BLAKE2b-256 631b8d86d2f38945527c139998c5cfe55d681530a527339590e65706da2393a0

See more details on using hashes here.

File details

Details for the file structura_py-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: structura_py-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for structura_py-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 57e6ff2b2e95ec93c54f359d36730a48be499f11cfdf27f561cd2e35bde7ae6c
MD5 85c615abe9159cc5fe6d53ef3ec2ba04
BLAKE2b-256 99be374d92f7694c6c7b630e5fea2e8c3279b142d78cf9f715e69d0df11bd092

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page