Potential Usages
FastDepends
is a great instrument to integrate with any frameworks you are already using. It can also be a part of your own tools and frameworks (HTTP or not* )
There are some usage examples with popular Python HTTP Frameworks:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
As you can see above, library, some middlewares and supporting classes... And you can use the whole power of typed Python everywhere.
Tip
FastDepends
raises pydantic.error_wrappers.ValidationError
at type casting exceptions.
You need to handle them and wrap them in your own response with your custom middleware if you want to use it in production.
Note
If you are interested in using FastDepends
in other frameworks, please take a look at my own Propan framework for working with various Message Brokers.