stas00/python-cookbook — explained in plain English
Analysis updated 2026-05-18
Look up a practical Python recipe for text handling, files, or subprocesses instead of searching the web.
Learn debugging, profiling, and testing techniques with runnable example code.
Read or download the book as a PDF or EPUB for offline reference.
Feed the included SKILL.md file to an AI coding agent to teach it everyday Python idioms.
| stas00/python-cookbook | eadmin2/jarvis_ai | greatvishal27-rc/ai-resume_analyzer | |
|---|---|---|---|
| Stars | 56 | 56 | 56 |
| Language | Python | Python | Python |
| Setup difficulty | easy | hard | moderate |
| Complexity | 1/5 | 4/5 | 2/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Stas' Python Cookbook is a free online book of practical Python recipes covering the standard library and the patterns that come up again and again in everyday coding work, such as handling text, working with lists and dictionaries, reading and writing files, running subprocesses, debugging, profiling, testing, and packaging. It targets Python 3.8 and newer, and calls out version differences where they matter. The book grew out of the author's personal cheat sheet, which they have kept and used daily for years. They used Claude to turn that dense, terse cheat sheet into fuller, more readable prose for this book, while the original raw cheat sheet is still available in the repository for anyone who prefers it. Each section explains why a technique matters before showing runnable example code, and points out common mistakes people run into when using it in practice. The content is organized into four parts. Part one covers core language features like strings, numbers, regular expressions, data structures, comprehensions, functions, classes, and dates. Part two covers the runtime environment, including modules and imports, files and paths, environment variables and arguments, subprocesses, serialization, concurrency, and networking. Part three covers debugging, profiling, and testing. Part four covers packaging, dependency management, code quality tools, and a few notes on scaling, plus an appendix of short one line tricks. Besides reading it as a website, you can download PDF and EPUB versions. The author also maintains a separate file called SKILL.md meant to teach AI coding agents these same everyday Python idioms, alongside two companion books by the same author on machine learning engineering and debugging. The content is released under the Creative Commons Attribution ShareAlike 4.0 license, and the author welcomes bug reports, typo fixes, and improvement suggestions through issues or pull requests.
A free online book of practical, example driven Python recipes covering everyday standard library patterns, from text handling to packaging.
Mainly Python. The stack also includes Python, Markdown.
Free to read, share, and adapt, even commercially, as long as you credit the author and share your own version under the same license.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.