NNaveeninnav610.hashnode.dev·Feb 6, 2023 · 2 min readPydantic Data ValidationThe last blog discussed a method of data validation, exemplified through a POST request, that utilized a class whose __init__ method attempted to assign parameters and threw an error if a parameter did not exist. Unfortunately, that class structure w...00
NNaveeninnav610.hashnode.dev·Jan 30, 2023 · 1 min readData ValidationOften, if not always, you want to validate an incoming payload to ensure it is passing the necessary parameters. If parameters are missing, you can fast-fail with an InvalidInput-like exception to quickly let the requester know the payload is malform...00
NNaveeninnav610.hashnode.dev·Nov 11, 2022 · 3 min readDependency InjectionDependency Injection and Inversion of Control is a bit like teenage sex - everyone is talking about it, everyone wants to try it, and yet nobody seems to understand it. A quick google search will find you overwhelmed by meaningless statements like ...00
NNaveeninnav610.hashnode.dev·Aug 22, 2022 · 1 min readCowsay GROMACSMany of us are familiar with cowsay, "a program which generates an ASCII image of a cow along with a message". You just add your message in quotes after the command like this: cowsay "hello world" For the adventurous, you can pipe the output of the...00
NNaveeninnav610.hashnode.dev·Aug 17, 2022 · 2 min readA Decorator to Record Execution TimeIt can be useful to measure the execution time of functions to ensure your code is running well. An execution time way longer than average implies an issue. Here is a lightweight context manager, implemented as a decorator, which saves some metrics o...00