Skip to main content

Add your description here

Project description

🏛️ Strura - The Architect's CLI

Constructing solid foundations for your code.

Strura is a high-performance code generation and scaffolding tool inspired by the elegance of php artisan. It is designed for developers who want to build robust applications using FastAPI, SQLAlchemy, and Pydantic without wasting time on repetitive boilerplate.

"Architecture is not just about how a project looks, but how it stands. Strura builds the foundation for you."


✨ Key Features

  • 🏗️ Smart Scaffolding: Create project structures based on Clean Architecture principles out of the box.
  • 🧩 Component Generation: Generate models, schemas, services, and controllers with a single command.
  • 🛡️ Type-Safe by Default: Generated code is 100% compliant with mypy and Pydantic v2 best practices.
  • 🚀 Language Agnostic DNA: While it excels in Python, the core engine is built to scale across any modern tech stack.
  • 🎨 Artisanal Code: We don't generate "junk code." Every file follows strict industry conventions and pep8 standards.

🚀 Quick Start

1. Initialize your project

You can use uv to initialize your project library:

uv init --lib strura

2. Install Strura

Install Strura globally or within your virtual environment:

pip install strura

3. Verify the installation

strura --version

🛠️ Usage & Commands

Strura uses an intuitive verb:subject syntax to keep your workflow fluid and readable.

  • Initialize a Project Set up a professional folder structure including Docker, Git, and Dependency Injection configurations.
    strura init my-awesome-api
    
  • Generate a Database Model Create a SQLAlchemy model with pre-configured mixins and migration support.
    strura gen:model User
    
  • Generate a Validation Schema Create Pydantic DTOs for data input, output, and partial updates.
    strura gen:schema User
    
  • Generate a Full API Resource Generate the model, schema, service layer, and API routes in one single step.
    strura gen:api Product --resource
    

📂 The Strura Directory Standard

Running strura init implements a production-ready directory structure designed for scalability:

.
├── app/
│   ├── api/          # Route definitions and endpoints
│   ├── core/         # Global config, security, and constants
│   ├── models/       # Database models (SQLAlchemy/SQLModel)
│   ├── schemas/      # Validation schemas (Pydantic)
│   ├── services/     # Business logic (The "Craft" layer)
│   └── main.py       # Application entry point
├── tests/            # Unit and integration test suites
├── alembic/          # Database migrations
├── pyproject.toml    # Modern dependency management
└── README.md

🔧 Customization

Tailor the code generation to your needs by creating a .strura.yaml file in your project root:

framework: fastapi
database: postgresql
orm: sqlalchemy
indentation: 4
naming_convention: snake_case
templates: ./custom_templates

🧑‍💻 Development

1. Clone and set up the virtual environment

git clone https://github.com/m4ck-y/strura.git
cd strura
uv sync
source .venv/bin/activate

2. Install the package in editable mode

uv pip install -e .

3. Run the CLI locally

strura hello-world
# Output: Hello, World!

4. Run the tests

uv run pytest -v

🤝 Contributing

Looking to improve Strura? We welcome architects of all levels!

  1. Fork the project.
  2. Create your feature branch: git checkout -b feature/amazing-logic.
  3. Commit your changes: git commit -m 'Add some amazing feature'.
  4. Push to the branch: git push origin feature/amazing-logic.
  5. Open a Pull Request.

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

strura-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

strura-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file strura-0.1.0.tar.gz.

File metadata

  • Download URL: strura-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for strura-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12ef16e8ccc6b0ec315e483e4d9829c1c17a270880de39a022a7d5584ac6c8d5
MD5 e0dca899369daaf4d20bbba080c3d9fc
BLAKE2b-256 f55b71eabbb320fde01d6aa78c5f12eb8f4b63a30e82319e730bfb14d5015a71

See more details on using hashes here.

File details

Details for the file strura-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: strura-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for strura-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b7aef6de441c36cbe8229eab50cda9ec0748c659ab8b8c33fb9bb465fe3ec2
MD5 7ed407f85a732f5a837420b3dfa7aeaf
BLAKE2b-256 d95ecb59cf8ac1cd9e9505d4b111044338fe998ba84069b1cc1402c02e691945

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