Generate avro schemas from python dataclasses, Pydantic models and Faust Records. Code generation from avro schemas. Serialize/Deserialize python instances with avro schemas.
Is your feature request related to a problem? Please describe.
Currently using AvroModel requires inheriting from it. Providing a fully functional interface would allow to use the functionality for all dataclasses. Also, this way certain rather generic method-names (like validate) that could clash with other names, would not be on every instance.
Example of this design philosophy is "attrs" the project from which dataclasses were originally derived.
Describe the solution you'd like
Looking through AvroModel, most methods seems to be classmethods - these could be extracted functionally and applied to the class passed as an argument. The instance-methods on AvroModel could be provided as functions applied to instances. The original AvroModel can get the same separately defined methods
Describe alternatives you've considered
Not sure what alternative to use. Enforcing use of AvroModel in an inheritance -schema if I dont control all classes myself seems difficult.
Is your feature request related to a problem? Please describe. Currently using AvroModel requires inheriting from it. Providing a fully functional interface would allow to use the functionality for all dataclasses. Also, this way certain rather generic method-names (like validate) that could clash with other names, would not be on every instance.
Example of this design philosophy is "attrs" the project from which dataclasses were originally derived.
Describe the solution you'd like Looking through AvroModel, most methods seems to be classmethods - these could be extracted functionally and applied to the class passed as an argument. The instance-methods on AvroModel could be provided as functions applied to instances. The original AvroModel can get the same separately defined methods
Describe alternatives you've considered Not sure what alternative to use. Enforcing use of AvroModel in an inheritance -schema if I dont control all classes myself seems difficult.
Additional context None