Extension for <ahref="https://github.com/marshmallow-code/marshmallow"target="_blank">`marshmallow`</a> to make <ahref="https://marshmallow.readthedocs.io/en/stable/quickstart.html#deserializing-to-objects"target="_blank">deserialization to objects</a> easier and improve type safety.
The main `GenericSchema` class extends <ahref="https://marshmallow.readthedocs.io/en/stable/marshmallow.schema.html#marshmallow.schema.Schema"target="_blank">`marshmallow.Schema`</a> making it **generic** in terms of the class that data should be deserialized to, when calling <ahref="https://marshmallow.readthedocs.io/en/stable/marshmallow.schema.html#marshmallow.schema.Schema.load"target="_blank">`load`/`loads`</a>.
With `GenericSchema` there is no need to explicitly write `post_load` hooks to initialize the object anymore. 🎉
If the "model" class is (for example) `User`, it just needs to be passed as the type argument, when subclassing `GenericSchema`. Depending on whether `many` is `True` or not, the output of the `load`/`loads` method will then be automatically inferred as either `User` or `list[User]` by any competent type checker. ✨
Adding `reveal_type(single_user)` and `reveal_type(multiple_users)` at the bottom and running that code through <ahref="https://mypy.readthedocs.io/en/stable/"target="_blank">`mypy`</a> would yield the following output:
```
# note: Revealed type is "User"
# note: Revealed type is "builtins.list[User]"
```
With the regular `marshmallow.Schema`, the output of `mypy` would instead be this:
```
# note: Revealed type is "Any"
# note: Revealed type is "Any"
```
This also means your IDE will be able to infer the types and thus provide useful auto-suggestions for the loaded objects. 👨💻