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!
- 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.1.tar.gz.
File metadata
- Download URL: strura-0.1.1.tar.gz
- Upload date:
- Size: 5.7 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 |
eb9a5cab56ba015d6ecf61cea8402cfffa8f61908eb9dbbedfabc9886c9ca334
|
|
| MD5 |
92cf647f65554c90e89d74749eec2b51
|
|
| BLAKE2b-256 |
36d2564c0e2dd391bfd0049606d0972a55672bb7a1c200358bb3e29ebdb56872
|
File details
Details for the file strura-0.1.1-py3-none-any.whl.
File metadata
- Download URL: strura-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 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 |
3fa14c842499811b7e644f0e93128b882525275821d8b86e7f7611b0f79cf62e
|
|
| MD5 |
e18629121ea9a12dca94d1ed1a1f59af
|
|
| BLAKE2b-256 |
af49e8a5a82d4af747262c8f513e82cd9630110925f16b8275df61507c29ba9b
|