py-automapper is a Python library designed for automatically mapping data from one object to another, reducing boilerplate code in data transfer operations. It is currently at version 2.2.0 and receives active maintenance with several releases per year.
pip install py-automapperVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to map a SourceDTO object to a UserDomainModel. It includes mapping configuration for different field names and a function configuration for custom value transformations, specifically concatenating first and last names into a full name.
Update calls to `automap` to pass the destination class, e.g., `automap(source_obj, DestinationClass)` instead of `automap(source_obj, DestinationClass())`.
Replace `map_config=...` with `mapping_cfg=...` in `automap` calls.
Change `automap_list(source_list, Destination)` to `automap(source_list, List[Destination], many=True)`.
Always provide a `mapping_cfg` dictionary when field names differ, or use `func_cfg` for value transformations.
No dependency data recorded yet.