Bendykit
Code generator for Python backends following DDD principles.
Describe your domain in a single Python file, get a full stack: domain models, repository, use cases, DTOs and FastAPI routers. Architecture is Onion, no ActiveRecord, strict layer separation.
Installation
pip install bendykit
Usage
# manifest.py
from decimal import Decimal
from enum import Enum
from typing import Optional
from datetime import datetime
from bendy import Aggregate, ValueObject, Field, auto_now
class OrderStatus(Enum):
PENDING = "pending"
CONFIRMED = "confirmed"
class Address(ValueObject):
street: str
city: str
country: str = "US"
class Order(Aggregate):
customer_id: str
total_amount: Decimal
status: OrderStatus = OrderStatus.PENDING
shipping_address: Address
notes: Optional[str] = None
created_at: datetime = auto_now
class Meta:
use_cases = ["create", "get", "update", "delete", "list"]
bendykit manifest.py ./src
Generates for each aggregate:
src/order/
├── domain/
│ ├── models.py # @dataclass Order
│ ├── enums.py # OrderStatus(Enum)
│ ├── value_objects.py # @dataclass(frozen=True) Address
│ └── repository.py # OrderRepository(ABC)
├── application/
│ ├── dtos.py # OrderCreate / OrderUpdate / OrderResponse
│ └── use_cases.py # Create/Get/Update/Delete/ListOrderUseCase
├── presentation/
│ └── router.py # FastAPI router
└── infrastructure/
├── models.py # OrderModel(Base) — SQLAlchemy 2.0
└── repository.py # SqlalchemyOrderRepository + mapper
Types
| Manifest | Python | SQLAlchemy |
|---|---|---|
str |
str |
String |
int |
int |
Integer |
float |
float |
Float |
bool |
bool |
Boolean |
Decimal |
Decimal |
Numeric |
datetime |
datetime |
DateTime |
date |
date |
Date |
UUID |
UUID |
String |
Optional[X] |
Optional[X] |
nullable=True |
MyEnum(Enum) |
MyEnum |
String + mapper |
MyVO(ValueObject) |
MyVO |
JSON |
Manifest primitives
auto_now— value is set server-side, excluded from Create/Update DTOsField(unique=True, index=True, max_length=N)— column metadataValueObject— nested object without id, stored as JSONMeta.use_cases— operations to generate:create,get,update,delete,list(default:create,get)
Roadmap
- Phase I — CLI generator
- Phase II — Python manifests (Enum, ValueObject, Field, auto_now, Meta)
- Phase III —
bendykit.runtime: Unit of Work, Domain Events
License
MIT
Metadata
Release files for bendykit 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bendykit-0.1.0.tar.gz | 15.6 kB | Without provenance | Details for bendykit-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bendykit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for bendykit-0.1.0-py3-none-any.whl |
Total release size: 32.0 kB
Release files / bendykit-0.1.0.tar.gz
| Download URL | bendykit-0.1.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd9d2502bd8ef9352192d2ad78242e1025ca1510042b07f2dc00a69f3100ff2c
|
|
BLAKE2b-256 checksum How to use checksums |
78495abbd1b7b914f6cfc828826467625cf3aab6ccdf5b19a19ab1665aa55106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / bendykit-0.1.0-py3-none-any.whl
| Download URL | bendykit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1695ce66127b9e5d2c420adb53ca04da0b4d8c4c9a7397472625aa7b4b585629
|
|
BLAKE2b-256 checksum How to use checksums |
7171fcb1d6c01923625895b876e46aac505d5a1b115458197b09698e41bbf883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for bendykit 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.