Study Python best practices in Chinese, covering naming, conditionals, data structures, decorators, and exception handling with real examples.
Learn how to apply SOLID design principles to Python code through before-and-after refactoring walkthroughs.
Use the articles as a study guide for writing cleaner, more maintainable Python in a professional context.
Content is written in Chinese, not suitable for readers who cannot read Mandarin.
One Python Craftsman is a collection of Chinese-language articles sharing practical Python programming knowledge, written by an experienced Python developer who goes by piglei. The repository covers coding techniques, best practices, and ways of thinking about software design problems. The articles have since been expanded and published as a physical book titled Python Craftsman: Cases, Techniques and Engineering Practices. The series is organized into sixteen topics. Early articles focus on foundational choices: how to name variables clearly, how to write clean conditional branches, and how to work effectively with Python data structures like lists, dictionaries, and sets. Later articles cover function design, exception handling, loops, decorators, and how Python module imports work, including the common problem of circular imports. A substantial portion of the series is devoted to object-oriented programming principles, specifically the SOLID design principles applied to Python code. These chapters walk through common mistakes and show how to refactor code to follow rules like keeping each class responsible for a single concern, making code open to extension without modification, and decoupling high-level logic from low-level implementation details. The README is written in Chinese, and the articles themselves are also in Chinese, making this resource primarily useful for Mandarin-reading Python developers rather than a general international audience. Three chapters are available as free reading on the author book website, and the rest are in the linked GitHub files. A mirrored website built by a community contributor also hosts all the articles in a more readable format than browsing raw Markdown files on GitHub.
← piglei on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.