A Recommended Read: Architecture Patterns with Python

technology books architecture

I came across ‘Architecture Patterns with Python’ by Harry Percival and Bob Gregory, also known as ‘Cosmic Python’. Released in March 2020 by O’Reilly Media, this book is a really nice, in-depth guide to architectural patterns specifically for Python developers.



Cover of Architecture Patterns with Python book

Why did they write the book?

At the end of Harry’s last book, Test-Driven Development with Python (O’Reilly), he found himself asking a bunch of questions about architecture, such as, What’s the best way of structuring your application so that it’s easy to test? More specifically, so that your core business logic is covered by unit tests, and so that you minimize the number of integration and end-to-end tests you need? He made vague references to “Hexagonal Architecture” and “Ports and Adapters” and “Functional Core, Imperative Shell,” but if he was honest, he’d have to admit that these weren’t things he really understood or had done in practice.
[…]
Our aim with this book is to introduce several classic architectural patterns and show how they support TDD, DDD, and event-driven services.

What I particularly like are the practical code examples provided in the book. They effectively illustrate the concepts discussed. The authors take a structured approach, integrating test-driven development (TDD) and Domain-Driven Design (DDD) principles.

Beyond just patterns, the book also includes helpful design tips, some inspiration for creating UML diagrams, and practical testing advice within its chapters. It’s a comprehensive resource for anyone looking to improve their understanding of building robust Python applications.

You can find the online version at https://www.cosmicpython.com/ and the O’Reilly link here: https://learning.oreilly.com/library/view/architecture-patterns-with/9781492052197/.


View this page on GitHub.