Code examples
402 standalone snippets under code_examples/, pulled from the chapter text, plus
20 additional worked examples under more_examples/.
These files are examples only. They illustrate concepts discussed in the chapters. Expect to put in extra work to mature them into proofs of concept, and do not use them in production as written. If one demonstrates an unsafe pattern without saying so, please report it.
On this page
Naming
Files in code_examples/ follow Part_NN_Chapter_X.Y_<topic>_code_NN_<name>.<ext>, so the chapter is in the name. They
are Python (373), YAML (17), shell (11), and JavaScript (1).
Each Part page lists its files under the chapter they belong to.
Files per Part
| Part | Snippets in code_examples/ |
Files in more_examples/ |
|---|---|---|
| Part 1 | 53 | 4 |
| Part 2 | 66 | 1 |
| Part 3 | 35 | 2 |
| Part 4 | 45 | — |
| Part 5 | 8 | 2 |
| Part 6 | 59 | 2 |
| Part 7 | 76 | 5 |
| Part 8 | 29 | 2 |
| Part 9 | 27 | — |
| Part 10 | 4 | 2 |
Some files are named for chapter numbers that are not in the current chapter list (3.1, 4.1C, 4.2A, 4.2B,
10.3); the Part pages list them separately as Other code examples.
Additional worked examples
Larger examples for selected Parts (no examples exist for Parts 4 and 9):
