A library for working with Google Protocol Buffers in Elixir, generating native Elixir modules and structs from .proto schemas.
Exprotobuf is an Elixir library that simplifies working with Google Protocol Buffers by automatically generating Elixir modules and structs directly from .proto schema files. It enables seamless encoding and decoding of protocol buffers for data exchange in Elixir applications, making protobufs feel native to the language.
Elixir developers who need to integrate with systems using Google Protocol Buffers for data serialization, such as microservices, gRPC APIs, or cross-language data exchange.
Developers choose exprotobuf because it leverages Elixir's strengths like pattern matching and structs, provides a clean API for encoding/decoding, and offers features like namespace support, selective injection, and oneof handling that align with Elixir idioms while maintaining compatibility with standard protobuf tooling.
Protocol Buffers in Elixir made easy!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates Elixir structs directly from .proto messages, enabling idiomatic pattern matching and easy instantiation with functions like Msg.new/1, as shown in the usage examples.
Supports loading from strings, individual files, or wildcard patterns (e.g., Path.wildcard), making it easy to integrate multiple .proto definitions into Elixir projects.
Represents protobuf oneof constructs as tuples like {:second, 42}, aligning with Elixir's pattern matching strengths for clear and concise code handling.
Offers options like use_package_names and namespace to control generated module names, allowing developers to respect protobuf package structures or flatten namespaces as needed.
Version 1.0 removed support for handling import statements, requiring manual workarounds for schemas with dependencies, as noted in the breaking changes and upgrade guide.
Combining :only with :inject is limited to single types, and use_in is described as tricky and less clean, making advanced module extensions cumbersome and error-prone.
The TODO section explicitly states that code and tests need cleanup, suggesting potential stability, documentation, or maintenance issues for long-term use.