--- id: py-automapper version: "2.2.0" license: MIT License Copyright (c) 2021 Andrii Nikolaienko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # py-automapper — Library for automatically mapping one object to another License: permissive · Maintenance: aging · Downloads: 193.2K/mo ## What it is and what it does py-automapper is a field-mapping library designed for layered architectures where objects need to be converted between different representations—such as mapping domain models to API DTOs or database models to presentation objects. It automatically copies matching fields from a source object to a target class instance, with support for field name remapping, value overrides, and optional deep copying to control object reference sharing. The library includes built-in extensions for popular frameworks: Pydantic/FastAPI models, TortoiseORM, and SQLAlchemy. You can register mappings once and reuse them, or map on-demand by specifying the target class. It handles dictionaries as source objects and allows customization through field mappings and extension points for advanced use cases. Use it for: - Convert domain model objects to API response DTOs while selectively exposing only public fields. - Map database ORM models to Pydantic models for API endpoints. - Transform data between layers in a multilayer architecture without manual field-by-field assignment. - Remap dictionary data into typed Python objects with field name translation. - Create read-only API representations by filtering sensitive fields during object mapping. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically maps object fields from one class to another, handling different field names, nested objects, and integration with Pydantic, TortoiseORM, and SQLAlchemy models. Yes, with conditions. Install if you need straightforward object-to-object mapping in a layered architecture and work with Pydantic, SQLAlchemy, or TortoiseORM. The library is stable and dependency-free, but maintenance was recently renewed after a long pause—monitor the repository for follow-through on the maintainer's commitment to resume active development before relying on it for critical systems. ## Install pip install py-automapper uv add py-automapper poetry add py-automapper ## Installing py-automapper Before you install: Low install friction with no runtime dependencies. Maintenance recently renewed after a pause; last release was 523 days ago but the maintainer has committed to resuming active development. Supports Python 3.8 through 3.13. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install py-automapper from automapper import mapper class Source: def __init__(self, name: str, age: int): self.name = name self.age = age class Target: def __init__(self, name: str): self.name = name source = Source("John", age) target = mapper.to(Target).map(source) print(vars(target)) Verify before relying: - Whether the maintainer's commitment to resume active development will result in regular releases and timely bug fixes. - Performance characteristics when mapping deeply nested object hierarchies or large collections. - Compatibility details with the latest versions of Pydantic v2, SQLAlchemy 2.x, and TortoiseORM. ## Package facts - License: MIT License Copyright (c) 2021 Andrii Nikolaienko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 193.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags object mapping between classes, dto conversion python, automatic field mapping, pydantic model mapping, sqlalchemy to dto, data transfer object mapper, cross-layer object conversion, dto-mapping, orm-integration, layered-architecture [View on SkillFed](https://skillfed.io/packages/py-automapper) · [View on PyPI](https://pypi.org/project/py-automapper/)