Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

code

> 编程语言
Open source

Example application code for the python architecture book

2.7K stars0 likes0 views
WebsiteGitHub

About

Example application code for the python architecture book

Example application code for the "Architecture Patterns with Python" book

Chapters

Each chapter has its own branch which contains all the commits for that chapter, so it has the state that corresponds to the end of that chapter. If you want to try and code along with a chapter, you'll want to check out the branch for the previous chapter.

https://github.com/cosmicpython/code/branches/all

Exercises

Branches for the exercises follow the convention {chapter_name}_exercise, eg https://github.com/cosmicpython/code/tree/chapter_04_service_layer_exercise

Requirements

  • docker with docker-compose
  • for chapters 1 and 2, and optionally for the rest: a local python3.8 virtualenv

Building the containers

(this is only required from chapter 3 onwards)

bash
make build
make up
# or
make all # builds, brings containers up, runs tests

Creating a local virtualenv (optional)

bash
python3.8 -m venv .venv && source .venv/bin/activate # or however you like to create virtualenvs

# for chapter 1
pip install pytest 

# for chapter 2
pip install pytest sqlalchemy

# for chapter 4+5
pip install -r requirements.txt

# for chapter 6+
pip install -r requirements.txt
pip install -e src/

Running the tests

bash
make test
# or, to run individual test types
make unit-tests
make integration-tests
make e2e-tests
# or, if you have a local virtualenv
make up
pytest tests/unit
pytest tests/integration
pytest tests/e2e

Makefile

There are more useful commands in the makefile, have a look and try them out.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言