python-dto-mappers¶
DTO mapping with type safety, auto-mapping, and field transformations.
Installation¶
pip install python-dto-mappers
Public API¶
Symbol |
Purpose |
|---|---|
|
Protocol for type-safe mapping |
|
Base mapper with type info |
|
Field-matching auto-mapper |
|
Decorator for auto-mapping |
|
Mark method as field transform |
|
PATCH partial updates |
|
Chain multiple mappings |
field mappers¶
Function |
Purpose |
|---|---|
|
datetime to ISO string |
|
ISO string to datetime |
|
Map nested objects |
|
Text transforms |
Usage¶
from python_dto_mappers import AutoMapper
mapper = AutoMapper(UserEntity, UserDTO)
dto = mapper.map(entity)