Himanshu Chauhanhimanshuchauhan.hashnode.dev·Mar 18, 2024Day 32: E-commerce project Day 2In this blog, I delve into the second day of my e-commerce project, which revolves around my exploration of FastAPI for project development. As I navigate through the intricacies of FastAPI, I am gaining invaluable insights into its capabilities and ...DiscussPython Python
Harsh Tiwariblogs.tiwariaiharsh.com·Feb 14, 2024From Chaos to Order: Structured JSON using Pydantic and Instructor with LLMsIn the world of Large Language Models (LLMs), making them play nice with our applications is key. We want our models to dish out neat JSON for easy integration into our full-stack setups. But relying solely on LLM luck for perfect JSON? Let's be real...Discuss·68 readsllm
Emre Erguvanchopin.hashnode.dev·Sep 15, 2023Validating recursive JSONs using JSON Schema in PythonEdit: Please note that it's much easier and faster to do this sort of validation directly using pydantic. If, however, you must use jsonschema, this post should be helpful. Hey there! Recently, while working on a Django app, I implemented validation ...Discuss·1 like·86 readsPython
Naveennav610.hashnode.dev·Feb 6, 2023Pydantic 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...Discuss·130 readsPython
Naveennav610.hashnode.dev·Jan 30, 2023Data 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...Discuss·99 readspydantic
Akash Desardaimportidea.hashnode.dev·Dec 13, 2022How to supercharge your config to make it truly environment agnosticAnyone who develops a project which involves multiple environments (e.g. DEV, QA, PROD) knows how painful it is to write code once which works everywhere, especially if it involves lots of env-specific tools (including cloud). I too have faced such p...Discuss·538 readsProgrammingenvironment-agnostic
Rune Hansén Steinnesroderik.no·Nov 26, 2022Settings and PythonSo, while working on this project I found I was using pydantic (a magnificent library btw.) for one thing and one thing only - settings management. To boot, I was managing a client secret and a tenant id. Nothing more. There has to be a simpler way, ...Discuss·53 readsPython 3
Alban Siffersituation.hashnode.dev·Oct 19, 2022Manage Django settings with Pydantic - Part 2In the previous part, we manage to use pydantic BaseSettings object to store common django settings. In this article, we use all the power of pydantic to handle common use-cases. Using environment variables In practice, we are likely to deploy our dj...Discuss·316 readsManage Django settings with PydanticDjango
Alban Siffersituation.hashnode.dev·Oct 18, 2022Manage Django settings with Pydantic - Part 1When our django project grows, we generally have to manage more and more settings: databases, security, cache, mails… And it quickly becomes a mess, scrolling hundreds of lines to change the CSRF header. In this series of articles, we will see how to...Discuss·402 readsManage Django settings with PydanticDjango
Rune Hansén Steinnesroderik.no·Aug 16, 2022Settings configuration with pydanticFor some reason I felt an urge to move from envsubst to a python based templating system. Enter pydantic. A fantastic package, which incidentally also can be used for settings management. I wanted to split my configs into logical chunks but still hav...Discuss·527 readsPython 3