
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
A Python codegen tool for transport layers in DDD, supporting most popular transport / API frameworks.
You shall pass... your domain to transport!
Gendalf is a Python code generation tool that simplifies the creation of transport layer code based on Domain-Driven Design (DDD) principles. With gendalf, you can effortlessly generate FastAPI, HTTPX, gRPC, aiohttp, and other transport framework code from your domain layer, ensuring that your business logic remains untouched while automating the generation of transport-related code.
With gendalf, you don’t have to worry about manually wiring your domain logic to transport code. Whether you're building APIs, microservices, or handling complex asynchronous communication, gendalf automates the transport layer creation: handles repetitive and error-prone process of writing endpoint handlers and clients from scratch, letting you focus on what matters most: your business logic.
This tool is designed for Python developers working on services that follow the Domain-Driven Design (DDD) approach. It's particularly useful for:
There are many tools for code generation in the Python ecosystem, but most are focused on simplifying specific tasks like serialization, or generating CRUD / REST operations. Here’s how gendalf project differs:
E.g. grpcio-tools
requires .proto
files specification first and generates client stubs & server interface, so on the
server side an additional code is required: implement request deserialization from protobuf python classes to domain
(value objects), invoke domain layer and then serialize protobuf response.
Run with gendalf src cast fastapi
. It supports:
src/api/models.py
: Pydantic models for requests and responses that mirror the domain objects. Used by client.py
and server.py
src/api/client.py
: Client classes with async methods, ready to make API calls with appropriate typings for request and
response data.src/api/server.py
: Server handler classes, which include data serialization and domain logic invocation.The generated code is complete, with no need for additional modifications.
This framework support is not supported yet.
FAQs
A Python codegen tool for transport layers in DDD, supporting most popular transport / API frameworks.
We found that gendalf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.