Tag

Pydantic

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
May 29, 2025 · Backend Development

From Hard‑Coded Secrets to YAML‑Powered Configs: A Backend Configuration Journey

This article walks through a step‑by‑step evolution of backend configuration management—from hard‑coded constants to modular config files, environment‑specific .env files, Pydantic‑validated models, and finally YAML‑based settings—demonstrating how to build a clean, secure, and scalable setup for FastAPI applications.

Configuration ManagementPydanticPython
0 likes · 17 min read
From Hard‑Coded Secrets to YAML‑Powered Configs: A Backend Configuration Journey
Code Mala Tang
Code Mala Tang
May 10, 2025 · Backend Development

Master FastAPI Request Body Validation with Pydantic Models

This guide explains how FastAPI uses Pydantic models to define, validate, and parse JSON and form request bodies, set default values and custom rules, handle nested structures, and return response models, providing a type‑safe, efficient way to build backend APIs.

API designPydanticPython
0 likes · 8 min read
Master FastAPI Request Body Validation with Pydantic Models
Code Mala Tang
Code Mala Tang
Mar 22, 2025 · Backend Development

Pydantic & FastAPI: Optional Fields, Nested Models, and Advanced Validation

Learn how to leverage Pydantic in FastAPI to handle optional fields, validate nested data structures, enforce complex business rules with model validators, forbid extra fields, work with polymorphic models, and validate query and path parameters, all illustrated with clear Python code examples.

API designPydanticPython
0 likes · 10 min read
Pydantic & FastAPI: Optional Fields, Nested Models, and Advanced Validation
Code Mala Tang
Code Mala Tang
Mar 17, 2025 · Backend Development

How to Efficiently Map Dictionaries to Python Classes: From Namedtuple to Pydantic

Mapping external data such as MongoDB query results or API responses to Python class attributes can be done manually, but this article explores several automated approaches—including namedtuple, setattr, a custom ModelBase/Type mapper, and Pydantic—detailing implementation, error handling, and performance benchmarks to guide developers in choosing the optimal solution.

Data mappingNamedtuplePerformance Benchmark
0 likes · 12 min read
How to Efficiently Map Dictionaries to Python Classes: From Namedtuple to Pydantic
Python Programming Learning Circle
Python Programming Learning Circle
Jul 18, 2023 · Backend Development

Frameworks and Tools that Inspired FastAPI

This article examines the various Python web frameworks, libraries, and standards—such as Django, Flask, Django REST Framework, Requests, Swagger/OpenAPI, Marshmallow, Pydantic, Starlette, and Uvicorn—that inspired FastAPI's design, highlighting their key features and how they contributed to FastAPI's capabilities.

APIPydanticbackend
0 likes · 10 min read
Frameworks and Tools that Inspired FastAPI
Python Programming Learning Circle
Python Programming Learning Circle
Jan 17, 2022 · Fundamentals

Six Alternatives to Classes in Python

This article compares six Python alternatives to traditional classes—plain classes, tuples, dictionaries, named tuples, attrs, dataclasses, and Pydantic—examining their syntax, validation capabilities, mutability, string representation, JSON (de)serialization, memory usage, and performance to help developers choose the most suitable data‑modeling approach.

ClassesData ModelingPydantic
0 likes · 17 min read
Six Alternatives to Classes in Python