Architecture Patterns with PythonHarry J.W. Percival, Bob Gregory
Architecture Patterns with Python
by Harry J.W. Percival, Bob Gregory · first published 2020
16mentions
12recommended by
15HN commenters
2020–2024first – last mentioned
80% recommend7% neutral13% critical
Why HN recommends it
Practical guide to applying domain-driven design, test-driven development and event-driven patterns in Python, with worked examples of isolating the domain; suited to working engineers moving past basic Python.
Common criticism: Some find the examples too trivial and a few patterns overly complex.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






Architecture Patterns with Python: Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices by Bob Gregory and Harry Percival
on “Can anyone recommend event-driven architecture book?” ↗I am also very interested to hear opinions on DDD. I recently finished _Architecture Patterns with Python_ [0] which talks about DDD and it was very good. They show some examples of what it looks like to properly highlight and isolate the domain and that was immediately applicable in my work. I am currently…
on “Ask HN: What do you think about Domain Driven Design?” ↗…1. Pycon videos - they're posted free on youtube. It's a great way to explore interesting problems with interesting people. 2. Another book on python by Harry Percival (he does a lot of TDD stuff) - Architecture Patterns with Python. This book is relatively new. It targets an rather niche audience (web devs). But it's hard-won knowledge and really well written. It's a wonderful resource for python devs, and a book I wish more people…
on “Ask HN: Best way to learn advanced Python?” ↗…Intermediate Level) - Effective Python (2nd Edition), Brett Slatkin (Intermediate Level) - Fluent Python (2nd Edition), Luciano Ramalho (Advanced Level) - CPython Internals, Anthony Shaw (Advanced Level) - Architecture Patterns with Python, Harry J. W. Percival & Bob Gregory (Advanced Level)
on “Ask HN: Python Programming Books” ↗If you’re using Python, I’d recommend Architecture Patterns with Python by Harry J.W. Percival and Bob Gregory.
on “Hexagonal Architecture and Domain Driven Design” ↗I'm guessing this was submitted after the "Ask HN" about leveling up to a production python programmer and i'm surprised no one mentioned these books: 1. Test-Driven Development with Python 2. Architecture Patterns with Python The 2nd one is the closest you're gonna get to a production-grade tutorial book. Related to this topic, these resources by @dbeazley: Barely an Interface https://github.com/dabeaz/blog/blob/main/2021/barely-interfa...…
on “Advanced Python Mastery – A Course by David Beazley” ↗I think “Architecture Patterns with Python” is a great book on multiple levels. First off it shows the natural progression of you code base as you build out features, achieve higher performance or want to increase reliability. Secondly it nicely…
on “Ask HN: Best way to learn advanced Python?” ↗For all the Python devs reading this, a book that aims to cover DDD from a Python perspective is Architecture Patterns With Python [1]. It's free to read online and all the code can be found in Github. [0]: https://www.cosmicpython.com/
on “Why Domain Driven Design?” ↗Similar resources: * Clean Architectures in Python: https://www.thedigitalcatbooks.com/pycabook-introduction/ * Architecture Patterns with Python: https://www.cosmicpython.com/book/preface.html * Collection of design patterns and idioms: https://github.com/faif/python-patterns)
on “Python Design Patterns (2018)” ↗See also: * "Python Design Patterns": https://python-patterns.guide/ * "Clean Architectures in Python": https://www.thedigitalcatbooks.com/pycabook-introduction * "Architecture Patterns with Python": https://www.cosmicpython.com/book/preface.html
on “Python-patterns – A collection of design patterns/idioms in Python” ↗I can recommend Architecture Patterns with Python [0] to learn how to refactor code in this way. I don't know Python but I found the examples to be relevant to many other languages as well! [0]: https://learning.oreilly.com/library/view/architecture-patte...
on “How to learn hard things in tech” ↗…it justice, but the idea took a good while to understand there reasons behind it. Some books that helped me grok the idea were - Patterns of Enterprise Application Architecture - Clean Architecture - Architecture Patterns with Python along with running into problems that could be easily solved with a decent abstraction at work and learning to apply it directly.
on “Ask HN: Concepts that clicked only years after you first encountered them?” ↗I'm a recent grad looking to keep improving. I've read Clean Code, Game Programming Patterns, and Architecture Patterns with Python, and I feel I learned / improved a lot from each of them. I was looking at Coding Horror's book recommendation list: https://blog.codinghorror.com/recommended-reading-for-developers/ but all those…
on “Ask HN: What books should I read to improve as a software engineer?” ↗…Intensive Applications has treated me well, getting me through pretty much every system design interview I have had. I am going to move onto either * O'Rielly Designing Distributed Systems or * O'Rielly Architecture Patterns with Python Could anyone recommend either one? I am mainly a Python dev (with no particular love for Python), but that doesn't necessarily make me want to use the Python book more. Having code examples I can grok…
on “Ask HN: Best books on modern distributed systems” ↗…chapter dedicated to the UI. How big is the sample application in the book? I've read a lot about DDD but things just don't seem to click for me, partly because example are trivial. For example, I read "Architecture Patterns with Python" (https://www.cosmicpython.com/book/preface.html) but just didn't find it practical. Some random thoughts I had while reading, in no particular order: * what if domain logic can be optimized in the database?…
on “Show HN: I wrote a book on implementing DDD, CQRS and Event Sourcing” ↗