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
- DDD-First Scaffolding: Create project structures based on Domain-Driven Design and Clean Architecture.
- Bounded Contexts: Generate isolated contexts with specific layers for Application, Domain, and Infrastructure.
- Type-Safe by Default: Generated code is 100% compliant with Pydantic v2 and FastAPI best practices.
- Powered by uv: Extremely fast dependency management and project initialization.
- Artisanal Code: Every file follows strict industry conventions, Pep8 standards, and structural best practices.
Philosophy
Strura follows the principles of:
- Domain-Driven Design (DDD)
- Hexagonal Architecture (Ports & Adapters)
- Strict layer separation
The core domain does not depend on external frameworks; Strura focuses on building the structural foundation.
Integrations
Strura can optionally integrate with:
- FastAPI
- SQLAlchemy
- core_api (auth, users, etc.)
Customization
The generated code is designed to be:
- Editable: No hidden logic; what you see is what you own.
- Extensible: Easily adapt the structure as your project grows.
- Independent: Once generated, the code does not depend on the scaffolder.
Installation
One-liner (installs uv + strura automatically)
curl -LsSf https://raw.githubusercontent.com/m4ck-y/strura/main/install.sh | bash
With uv (if already installed)
uv tool install strura
With pipx
pipx install strura
With pip
pip install strura
Verify the installation
strura --help
Quick Start
Initialize a new project
strura init my-awesome-api
Or scaffold the current directory
mkdir my-api && cd my-api
strura init .
Usage & Commands
Strura uses an intuitive verb:subject syntax to keep your workflow fluid and readable.
- Initialize a Project
Set up a professional DDD structure. Supports creating a new folder (Mode A) or formatting the current one (Mode B).
strura init my-awesome-api
- Generate a Bounded Context
Create a new isolated context with Application, Domain, and Infrastructure layers.
strura gen:context billing
Roadmap (Coming Soon)
strura gen:schema <context>.<entity>: Pydantic DTOs for input/output.strura gen:api <context>.<resource>: Full CRUD endpoints.
The Strura Directory Standard
Running strura init implements a production-ready directory structure designed for scalability:
.
├── app/
│ ├── contexts/ # Isolated bounded contexts (DDD)
│ ├── settings/ # Environment and Database config
│ ├── shared/ # Common code across contexts
│ └── main.py # FastAPI entry point
├── tests/ # Unit and integration test suites
├── docs/ # Command-specific documentation
├── .agent/ # AI Agent workflows and rules
├── pyproject.toml # Dependency management (uv)
└── 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 & Publishing
1. Testing
To add dependencies and run tests:
uv add --dev pytest
uv run pytest -vv
2. Publishing
To develop locally, build, and publish:
# Install in editable mode
uv pip install -e .
# Build the package
uv build
# Publish to PyPI (requires API Token)
uv publish
AI-Agent Workflows
This project is specialized for Agentic Development. We maintain strict standards for AI agents in the .agent/ directory:
- Workflows: Standardized processes for documentation, Git, and automation.
- Rules: Best practices for FastAPI, Pydantic, and SQLAlchemy.
For more details, check .agents/workflows/WRITING.md.
Contributing
Looking to improve Strura? We welcome architects of all levels!
- Fork the project.
- Create your feature branch:
git checkout -b feature/amazing-logic. - Commit your changes:
git commit -m 'Add some amazing feature'. - Push to the branch:
git push origin feature/amazing-logic. - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strura-0.1.2.tar.gz.
File metadata
- Download URL: strura-0.1.2.tar.gz
- Upload date:
- Size: 9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bdfa330d63f022d9954b652bd2b328ef0582e39e0be81ab6c3733dee06f209f
|
|
| MD5 |
43629f05f7e4655fb4d1b7267982555e
|
|
| BLAKE2b-256 |
1f06ec9ced5a94ef8fb5442c4b0c449f0fdecd43ab55d4ec714b1eb641eb1eca
|
File details
Details for the file strura-0.1.2-py3-none-any.whl.
File metadata
- Download URL: strura-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbfa6987d29fd6190e1c3f78c420414f34ce9c6e299a1efe9d47816b55353f7
|
|
| MD5 |
a316b1da55994492ced58b01d87fac1e
|
|
| BLAKE2b-256 |
5ff3b10a607ba52d4dbd55687a89ceaa9a4dddc761a8d40457bf3f89657a8f46
|