An Elixir presenter package for transforming map structures, enabling flexible API output serialization.
Remodel is an Elixir presenter package that transforms data structures, particularly when the desired output representation doesn't match the underlying database schema. It allows developers to define API output structures separately from their data models using a simple DSL, making it ORM-agnostic and suitable for JSON, XML, or CSV serialization.
Elixir developers building APIs or data serialization layers, especially those using Phoenix and Ecto who need flexible, decoupled output representations. It's also suitable for developers generating CSV files or needing conditional attribute rendering based on external context.
Developers choose Remodel for its ORM-agnostic approach, allowing serialization from any map-like structure without being tied to a specific database library. Its unique selling points include scope awareness for context-dependent output, support for root nodes and metadata, and built-in list generation for CSV export.
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir"
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works with any map-like structure, including Ecto models, without being tied to a specific database library, allowing serialization from diverse data sources as shown in the overview.
Supports scope data to conditionally include attributes based on external context like authenticated users, enabling fine-grained output control as demonstrated in the scope example.
Facilitates JSON, XML, or CSV serialization with built-in list generation for CSV exports, making it easy to transform maps to lists with headers as illustrated in the list generation section.
Allows adding root nodes and metadata for structured API responses, useful for pagination and nested JSON configurations, evident in the root and meta examples.
Lacks built-in handling of Ecto associations, requiring manual preloading and processing, which is explicitly listed as a missing feature in the roadmap.
Conditional attributes only support method names, not anonymous functions, making it less flexible for dynamic logic compared to other libraries, as noted in the roadmap.
The README acknowledges that typespecs and detailed documentation are pending, which can hinder adoption, debugging, and type safety in larger projects.
remodel is an open-source alternative to the following products: