|
| 1 | +# SOLID Principles in Python |
| 2 | + |
1 | 3 | <p align="center"> |
2 | 4 | <img src="assets/banner.png" alt="SOLID Principles in Python" /> |
3 | 5 | </p> |
4 | 6 |
|
5 | | -Learn the five SOLID design principles with small Python examples (**violation** vs **correct**) and UML class diagrams. |
6 | | - |
7 | | -| Docs site | https://yakhyo.github.io/solid-python/ | |
8 | | -|-----------|----------------------------------------| |
9 | | -| Source | https://github.com/yakhyo/solid-python | |
10 | | - |
11 | | -## Requirements |
12 | | - |
13 | | -- **Python 3.10+** (for running the examples) |
14 | | -- **Ruby 3.x + Bundler** (only for running the docs site locally) |
| 7 | +<p align="center"> |
| 8 | + <b>Learn SOLID design principles through Python examples — violation vs correct, with UML diagrams.</b> |
| 9 | +</p> |
15 | 10 |
|
16 | | -## Running the examples |
| 11 | +<p align="center"> |
| 12 | + <a href="https://yakhyo.github.io/solid-python/">Documentation</a> · <a href="https://yakhyo.github.io/solid-python/uz/">O'zbekcha</a> |
| 13 | +</p> |
17 | 14 |
|
18 | | -Each example is a standalone script with no external dependencies. |
| 15 | +## Quick start |
19 | 16 |
|
20 | 17 | ```bash |
21 | | -python 01-single-responsibility/violation.py |
22 | | -python 01-single-responsibility/correct.py |
| 18 | +python docs/01-srp/violation.py |
| 19 | +python docs/01-srp/correct.py |
23 | 20 | ``` |
24 | 21 |
|
25 | | -## Running the docs site locally |
| 22 | +Requires **Python 3.10+**, no external dependencies. |
| 23 | + |
| 24 | +## Docs site locally |
26 | 25 |
|
27 | 26 | ```bash |
28 | 27 | bundle install |
29 | 28 | bundle exec jekyll serve --livereload |
30 | 29 | ``` |
31 | 30 |
|
32 | | -Open `http://localhost:4000/solid-python/` in your browser. |
| 31 | +Then open `http://localhost:4000/solid-python/` |
33 | 32 |
|
34 | | -## Repository layout |
| 33 | +## Structure |
35 | 34 |
|
36 | 35 | ```text |
37 | | -. |
38 | | -├── 01-single-responsibility/ # S — Single Responsibility Principle |
39 | | -│ ├── violation.py |
40 | | -│ ├── correct.py |
41 | | -│ ├── README.md # English docs |
42 | | -│ └── README.uz.md # Uzbek docs |
43 | | -├── 02-open-closed/ # O — Open/Closed Principle |
44 | | -├── 03-liskov-substitution/ # L — Liskov Substitution Principle |
45 | | -├── 04-interface-segregation/ # I — Interface Segregation Principle |
46 | | -├── 05-dependency-inversion/ # D — Dependency Inversion Principle |
47 | | -├── assets/ # UML class diagrams |
48 | | -├── index.md / index.uz.md # Home pages (EN / UZ) |
49 | | -├── _config.yml # Jekyll configuration |
50 | | -├── Gemfile # Jekyll dependencies |
51 | | -└── .github/workflows/ |
52 | | - └── pages.yml # GitHub Pages deployment |
| 36 | +docs/ |
| 37 | +├── 01-srp/ # Single Responsibility |
| 38 | +├── 02-ocp/ # Open/Closed |
| 39 | +├── 03-lsp/ # Liskov Substitution |
| 40 | +├── 04-isp/ # Interface Segregation |
| 41 | +├── 05-dip/ # Dependency Inversion |
| 42 | +│ ├── violation.py # What goes wrong |
| 43 | +│ ├── correct.py # How to fix it |
| 44 | +│ ├── README.md # English docs |
| 45 | +│ └── README.uz.md # Uzbek docs |
| 46 | +├── index.md # Home (EN) |
| 47 | +└── index.uz.md # Home (UZ) |
53 | 48 | ``` |
54 | 49 |
|
55 | 50 | ## License |
56 | 51 |
|
57 | | -MIT — see [LICENSE](LICENSE). |
| 52 | +MIT — [LICENSE](LICENSE) |
0 commit comments