My blog post about separating Pydantic from the domain layer blew up today. Almost 2k visitors in just one day!! Who would’ve ever dreamed that?

#pydantic #fastapi #python #python3 #pythonprogramming #webdevelopment #softwareengineering

With the rising popularity of FastAPI and Pydantic, it's becoming increasingly important to protect a clean domain, free from third-party tools. I wrote an article to help you with that.

https://coderik.nl/posts/keep-pydantic-out-of-your-domain-layer/

#fastapi #pydantic #softwaredevelopment #python #cleancode #architecturepatterns #pythonprogramming

Keep Pydantic out of your Domain Layer | Coderik

Stop Pydantic leaking into your domain layer. Use lightweight mappers or dacite to convert Pydantic models into pure old python dataclasses and keep your domain layer free of third-party libraries.

🌘 保持 Pydantic 遠離你的網域層
➤ 將 Pydantic 限制在應用程式的邊緣
https://coderik.nl/posts/keep-pydantic-out-of-your-domain-layer/
這篇文章探討了在軟體開發中,避免將 Pydantic 引入過多的層次,特別是網域層的問題。作者分享了自身經驗,說明瞭雖然 Pydantic 在資料驗證方面非常方便,但過度依賴可能導致耦合性增加,影響系統的可維護性和可測試性。文章介紹了使用 Dacite 等工具,將 Pydantic 模型轉換為純粹的 Python 物件,以實現更好的分層和關注點分離。
+ 這篇文章點出了我一直以來遇到的問題,Pydantic 真的很好用,但濫用會導致程式碼變得難以維護。
+ Dacite 聽起來很有用,我會嘗試看看它是否能解決我目前的架構問題。
#軟體架構 #Pydantic #乾淨架構
Keep Pydantic out of your Domain Layer | Coderik

Stop Pydantic leaking into your domain layer. Use lightweight mappers or dacite to convert Pydantic models into pure old python dataclasses and keep your domain layer free of third-party libraries.

Нагрузочное тестирование на Python и Locust с запуском на CI/CD

Разбираемся, как организовать нагрузочное тестирование на Python с Locust — с сидинговыми сценариями , кастомными API-клиентами на HTTPX, конфигурацией через Pydantic и автоматическим запуском в GitHub Actions . Всё — на практике, с архитектурой, фреймворком и публикацией отчётов в GitHub Pages.

https://habr.com/ru/articles/929136/

#нагрузка #нагрузочное_тестирование #нагрузочные_тесты #python #locust #тестирование_производительности #cicd #github_actions #httpx #pydantic

Нагрузочное тестирование на Python и Locust с запуском на CI/CD

Введение В этой статье я наглядно покажу, как организовать нагрузочное тестирование с использованием Python и фреймворка Locust , опираясь на инженерные практики и удобную архитектуру. Цель статьи —...

Хабр

Šimon Podhajský presents the talk "Pydantic, Everywhere, All at Once" to a packed room at the EuroPython 2025 conference.

https://ep2025.europython.eu/session/pydantic-everywhere-all-at-once

#EuroPython #EuroPython2025 #Pydantic #FastAPI

CC @europython @FastAPI @pydantic

If you ever ask why it’s worth updating #Python dependencies from time to time, #Pydantic serves as a nice example with the performance boost introduced. I actually could see it, given the complexity of models I deal with on a daily basis.

> Recent memory usage optimizations are most relevant for projects with lots of models, particularly those with nested/reused models. In these cases, you can expect a 2-5x reduction in memory usage.

#DailyPythonista
https://pydantic.dev/articles/pydantic-v2-11-release

Pydantic v2.11 | Pydantic

Pydantic v2.11 release highlights

🐍 Loading #pydantic models from #JSON without running out of memory — by @itamarst

TIL #python slots usage 🙏

https://pythonspeed.com/articles/pydantic-json-memory/

Loading Pydantic models from JSON without running out of memory

Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.

Python⇒Speed
Design Pressure

Ever had this weird gut feeling that something is off in your code, but couldn’t put the finger on why? Are you starting your projects with the best intentions, following all best practices, and still feel like your architecture turns weird eventually?

Hynek Schlawack

"Loading Pydantic models from JSON without running out of memory"

https://pythonspeed.com/articles/pydantic-json-memory/

#python #pydantic

Loading Pydantic models from JSON without running out of memory

Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.

Python⇒Speed
Si vous utilisez #Pydantic, et que vous êtes confronté·es à des problèmes d'allocation mémoire lors de chargement de #JSON volumineux, voici une exemple de comment contourner le problème, en utilisant la bibliothèque #Python ijson.
https://pythonspeed.com/articles/pydantic-json-memory/
Loading Pydantic models from JSON without running out of memory

Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.

Python⇒Speed